From 56caf65cf04bd58dd8e58885cf6cdba86a38f0ee Mon Sep 17 00:00:00 2001 From: Brandon Pitman Date: Wed, 20 Sep 2023 12:33:49 -0700 Subject: [PATCH] Fix dependabot automerge. The important fix is GITHUB_TOKEN -> GH_TOKEN. Despite the gh CLI allowing either, apparently in the context of Github Actions GITHUB_TOKEN is not allowed. --- .github/workflows/dependabot-automerge.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/dependabot-automerge.yml diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000000..0e5bd2a425 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,12 @@ +name: Dependabot auto-merge +on: pull_request + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + - name: Approve & enable auto-merge for Dependabot PRs + run: gh pr review --approve -b "Auto-approving dependabot PR." "$PR_URL" && gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.DIVVIUP_GITHUB_AUTOMATION_DEPENDABOT_APPROVER_PAT }} \ No newline at end of file