diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..5df01e4 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,29 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + actions: write + +jobs: + dependabot: + runs-on: ubuntu-latest + # Only run for dependabot PRs + if: github.event.pull_request.user.login == 'dependabot[bot]' + steps: + - name: Fetch Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v3 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Approve and Enable auto-merge + # We removed the semver-major check + if: success() + run: | + gh pr review --approve "$PR_URL" + gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}