From acadbf7d1064c60f10fd0891d792654ee8fe3fd3 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Wed, 9 Apr 2025 16:56:46 -0400 Subject: [PATCH] Create dependabot-auto-merge.yaml Signed-off-by: Mathieu Benoit --- .github/workflows/dependabot-auto-merge.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/dependabot-auto-merge.yaml diff --git a/.github/workflows/dependabot-auto-merge.yaml b/.github/workflows/dependabot-auto-merge.yaml new file mode 100644 index 0000000..3f6a2a1 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yaml @@ -0,0 +1,20 @@ +name: Dependabot auto-merge +on: pull_request +permissions: + contents: write + pull-requests: write +jobs: + dependabot-auto-merge: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && !github.event.pull_request.auto_merge }} + steps: + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}