From 9ed673b41329fce0932620eec4c152a584d8b6ac Mon Sep 17 00:00:00 2001 From: Anilcan Cakir Date: Sun, 30 Aug 2026 02:16:27 +0300 Subject: [PATCH] ci(deps): auto-merge low-risk Dependabot PRs, as wind already does Workflow-action bumps sit open across the ecosystem for days, all green, all identical, none of them anything a person needed to read. Scope is deliberately narrow: `github_actions` minor and patch only. A pub dependency reaches the package's own resolution graph and a major bump is a breaking change by declaration, so both keep a human. `--auto` queues the merge behind the required checks rather than merging on the spot, and there is no approve step because GITHUB_TOKEN cannot approve a pull request: an approve step would fail on every bump, and a check that is always red teaches you to stop reading red checks. --- .github/workflows/dependabot-auto-merge.yml | 41 +++++++++++++++++++++ 1 file changed, 41 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 0000000..4d33552 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,41 @@ +name: Dependabot auto-merge + +on: + pull_request_target: + branches: [master] + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + name: Auto-merge low-risk Dependabot PRs + if: github.event.pull_request.user.login == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Fetch Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + # Arming auto-merge is the whole job, and the merge still waits for CI: + # `--auto` queues it behind the required checks rather than merging now. + # There is no approve step on purpose. GITHUB_TOKEN cannot approve a pull + # request ("Allow GitHub Actions to create and approve pull requests" is + # off org-wide), so an approve step would fail on every single bump, and a + # check that is always red teaches you to stop reading red checks. + # + # Scope is deliberately narrow: workflow action bumps only, minor and + # patch. A pub dependency reaches the package's own resolution graph and a + # major bump is a breaking change by declaration, so both keep a human. + - name: Arm auto-merge for GH Actions minor + patch + if: | + steps.metadata.outputs.package-ecosystem == 'github_actions' && + (steps.metadata.outputs.update-type == 'version-update:semver-minor' || + steps.metadata.outputs.update-type == 'version-update:semver-patch') + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr merge --auto --squash "$PR_URL"