File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ name: Dependabot Automerge
22permissions :
33 contents : write
44 pull-requests : write
5+ # `actions: write` lets the post-merge step kick off Node.js Package on
6+ # the default branch via `gh workflow run`. Without this, automerge'd
7+ # PRs land on main but the on-push release job never fires (GitHub
8+ # Actions intentionally suppresses on:push triggers when the push is
9+ # authenticated with GITHUB_TOKEN).
10+ actions : write
511on :
612 workflow_run :
713 workflows :
@@ -21,10 +27,19 @@ jobs:
2127 uses : actions/checkout@v6
2228
2329 - name : Automerge
30+ id : automerge
2431 uses : " pascalgn/automerge-action@v0.16.4"
2532 env :
2633 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2734 MERGE_METHOD : squash
2835 MERGE_LABELS : " "
2936 MERGE_RETRY_SLEEP : " 100000"
3037
38+ - name : Trigger release on default branch
39+ # `pascalgn/automerge-action` exits 0 whether or not it merged. Skip
40+ # the dispatch when nothing was actually merged so we don't kick a
41+ # phantom release run on every Dependabot Automerge invocation.
42+ if : steps.automerge.outputs.mergeResult == 'merged'
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ run : gh workflow run test-and-release.yml --ref ${{ github.event.repository.default_branch }}
Original file line number Diff line number Diff line change 11name : Node.js Package
2- on : [push]
2+ on :
3+ push :
4+ # Invoked by automerge.yml after a Dependabot PR is merged. GitHub
5+ # Actions doesn't fire on:push when the push is authored by GITHUB_TOKEN
6+ # (the automerge action's only available identity), so without this
7+ # dispatch trigger the release job never runs after auto-merges.
8+ workflow_dispatch :
39
410# id-token: write must be granted here so the reusable npmpublish workflow
511# can request an OIDC token for npm trusted publishing.
You can’t perform that action at this time.
0 commit comments