From 2ff710a131a8b0bbc01094aa9b03a99855e1e08a Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 31 Aug 2022 16:56:33 -0700 Subject: [PATCH] github: enable auto-merge on Dependabot PRs To merge a Dependabot PR, I have to enable auto-merge (two clicks, including one to confim) and then review and approve it. Since our branch protections require the PR to be approved, it seems that that should be enough. This patch adds a GitHub action that calls runs the GitHub CLI to do that. It is based on https://dev.to/slashgear_/how-to-automatically-merge-dependabot-pull-requests-with-github-actions--30pe --- .github/workflows/dependabot.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 000000000..baa7e6a7f --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,18 @@ +name: build + +on: + pull_request: + +permissions: read-all + +jobs: + dependabot-auto-merge: + name: 'Dependabot auto-merge' + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}