Skip to content

Commit cefe499

Browse files
committed
ci: migrate automerge to native GitHub auto-merge
Replace eetu/action-automerge (polling + gh pr merge --admin, which could not handle strict branch protection on a behind branch) with GitHub native auto-merge. Squash method; skip github-actions bumps (GITHUB_TOKEN lacks the workflows scope to squash-merge them).
1 parent bfdcbe1 commit cefe499

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

‎.github/workflows/automerge.yaml‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Automerge
22

33
on:
44
pull_request:
5-
branches: [develop]
65

76
permissions:
87
contents: write
@@ -11,16 +10,15 @@ permissions:
1110
jobs:
1211
automerge:
1312
runs-on: ubuntu-latest
14-
timeout-minutes: 10
15-
# Skip github-actions bumps: they edit .github/workflows/*, which GITHUB_TOKEN
16-
# cannot merge (no `workflows` permission scope) — the run would fail and leave
17-
# a red X on the PR. Merge those by hand (and review the CI change). Everything
18-
# else (npm/cargo/pip/uv/docker) automerges on the plain GITHUB_TOKEN.
13+
timeout-minutes: 5
14+
# Native GitHub auto-merge: GitHub squash-merges the PR once required checks
15+
# pass. Only dependabot. Skip github-actions bumps — a squash merge re-authors
16+
# the workflow-file change as GITHUB_TOKEN, which lacks the `workflows` scope
17+
# and is rejected; merge those by hand after reviewing the CI change.
1918
if: github.actor == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/github_actions')
20-
2119
steps:
22-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
23-
- name: Automerge Dependabot PR
24-
uses: eetu/action-automerge@3b0f8a84c10e656fd6775c5792265c64c8961ed9 # v1
25-
with:
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Enable auto-merge
21+
run: gh pr merge --auto --squash "$PR_URL"
22+
env:
23+
PR_URL: ${{ github.event.pull_request.html_url }}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)