diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..3bd50c3 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,31 @@ +name: Auto-merge Dependabot PRs + +on: pull_request + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + name: Auto-merge + + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Get Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v1.6.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Approve the PR + run: gh pr review --approve "${{ github.event.pull_request.html_url }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge + run: gh pr merge --merge --auto "${{ github.event.pull_request.html_url }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}