Skip to content

Commit e395d76

Browse files
committed
ci: merge Dependabot PRs with a GitHub App token instead of GITHUB_TOKEN
GitHub does not let GITHUB_TOKEN-authenticated pushes trigger further workflow runs, so every prior auto-merge landed on main without triggering ci.yml or a semantic-release publish. A GitHub App installation token, minted via actions/create-github-app-token using the org-installed app whose private key is stored as the AUTOMERGE_APP_PRIVATE_KEY organization secret, does not carry that restriction, so the resulting push now cascades normally.
1 parent 09dc62d commit e395d76

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Dependabot auto-merge
22

3-
# Two auto-merge policies in one workflow. Sibling ExaDev packages (documents.js/odf.js) merge unconditionally once green -- no cooldown, matching this family's existing convention. Every other (third-party) dependency merges only for a minor or patch bump; a major bump still opens a PR via Dependabot but is left for manual review. Third-party updates additionally carry dependabot.yml's own 7-day cooldown before Dependabot proposes them at all. Auto-merge is enforced by main's own CI actually passing on the PR's head commit -- this workflow only requests the merge, GitHub itself withholds it until checks conclude.
3+
# Two auto-merge policies in one workflow. Sibling ExaDev packages (documents.js/odf.js) merge unconditionally once green -- no cooldown, matching this family's existing convention. Every other (third-party) dependency merges only for a minor or patch bump; a major bump still opens a PR via Dependabot but is left for manual review. Third-party updates additionally carry dependabot.yml's own 7-day cooldown before Dependabot proposes them at all. Auto-merge is enforced by main's own CI actually passing on the PR's head commit -- this workflow only requests the merge, GitHub itself withholds it until checks conclude -- and the merge authenticates via a GitHub App installation token specifically so the resulting push cascades into ci.yml/release, unlike a GITHUB_TOKEN-authenticated push.
44

55
on:
66
pull_request:
@@ -43,9 +43,15 @@ jobs:
4343
else
4444
echo "merge=false" >> "$GITHUB_OUTPUT"
4545
fi
46+
- name: Generate a token for the merge
47+
id: app-token
48+
uses: actions/create-github-app-token@v2
49+
with:
50+
app-id: "4473709"
51+
private-key: ${{ secrets.AUTOMERGE_APP_PRIVATE_KEY }}
4652
- name: Enable auto-merge
4753
if: steps.decide.outputs.merge == 'true'
4854
run: gh pr merge --auto --rebase "$PR_URL"
4955
env:
5056
PR_URL: ${{ github.event.pull_request.html_url }}
51-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)