diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..21285d13 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,28 @@ +name: Auto-Merge Dependabot PRs + +on: + pull_request: + +jobs: + automerge: + name: Auto-Merge Dependabot PRs + + runs-on: ubuntu-latest + + permissions: + pull-requests: write + contents: write + + if: github.actor == 'dependabot[bot]' + steps: + - name: Get Dependabot metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Enable auto-merge + run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82e26ff3..39a95672 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,20 +59,4 @@ jobs: validate: name: Validate uses: ./.github/workflows/validate.yml - secrets: inherit - - automerge: - name: "Auto Approve" - needs: [build, validate] - - runs-on: ubuntu-latest - - permissions: - pull-requests: write - contents: write - - steps: - - uses: fastify/github-action-merge-dependabot@v3 - with: - target: major - use-github-auto-merge: true \ No newline at end of file + secrets: inherit \ No newline at end of file