From 84c619e3cc42cda7d03e4767e6d321c3615c0687 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 22 Mar 2026 23:25:30 +0000 Subject: [PATCH] Add Dependabot auto-merge workflow - Creates a GitHub Action that automatically merges Dependabot PRs when tests pass - Waits for CI checks to complete before enabling auto-merge - Skips auto-merge for major version updates --- .github/workflows/dependabot-auto-merge.yml | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..0d57f704 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,37 @@ +name: Dependabot Auto Merge + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot-auto-merge: + name: Dependabot Auto Merge + if: github.actor == 'dependabot' + runs-on: ubuntu-latest + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Wait for CI tests to pass + uses: kachick/wait-other-jobs@v1 + timeout: 60m + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Enable auto-merge + if: steps.metadata.outputs.update-type != 'version-update:semver-major' + run: | + gh pr merge --admin --auto "${{ github.event.pull_request.number }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}