@@ -14,10 +14,60 @@ jobs:
1414 pull-requests : write
1515 outputs :
1616 release_created : ${{ steps.release.outputs.release_created }}
17+ # Non-empty JSON when release-please created or updated a release PR
18+ # this run. Used by `reattribute` below to decide whether to amend.
19+ pr : ${{ steps.release.outputs.pr }}
1720 steps :
1821 - name : Create Release PR
19- uses : googleapis/release-please-action@v4
2022 id : release
23+ uses : googleapis/release-please-action@v5
24+ with :
25+ config-file : .github/release-please-config.json
26+ manifest-file : .github/release-please-manifest.json
27+ # Bot PAT with access to Workflows
28+ # The built-in GITHUB_TOKEN has cannot trigger other workflows
29+ token : ${{ secrets.GH_PAT }}
30+
31+ # release-please-action commits the release PR's contents as the PAT
32+ # owner (the action has no input to override the commit author). Re-attribute
33+ # to github-actions[bot] so the PR shows the bot as author instead of the
34+ # person the PAT belongs to.
35+ reattribute :
36+ needs : release-please
37+ if : ${{ needs.release-please.outputs.pr != '' }}
38+ runs-on : ubuntu-latest
39+ permissions :
40+ contents : write
41+ # Cosmetic best-effort: rewrites the release-PR commit author to the bot. If
42+ # the release PR is merged before this runs, its branch is deleted and the
43+ # checkout below can't fetch it — don't fail the release workflow over that.
44+ continue-on-error : true
45+ env :
46+ # release-please's branch name varies by config (`release-please--branches--<base>`
47+ # for single-package, with extra `--components--<name>` segments for component mode).
48+ # The action emits the PR object as JSON — pull `headBranchName` from it instead of
49+ # guessing the pattern.
50+ PR_BRANCH : ${{ fromJSON(needs.release-please.outputs.pr).headBranchName }}
51+ steps :
52+ - name : Checkout release-please branch
53+ uses : actions/checkout@v7
54+ with :
55+ token : ${{ secrets.GH_PAT }}
56+ ref : ${{ env.PR_BRANCH }}
57+ fetch-depth : 2
58+
59+ - name : Configure git
60+ run : |
61+ git config user.name "github-actions[bot]"
62+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
63+
64+ - name : Amend release commit as github-actions[bot]
65+ run : |
66+ set -euo pipefail
67+ # --reset-author rewrites both author and committer to the configured
68+ # identity; --no-edit keeps the existing commit message verbatim.
69+ git commit --amend --reset-author --no-edit
70+ git push origin "$PR_BRANCH" --force-with-lease
2171
2272 publish :
2373 needs : release-please
2878 id-token : write # for provenance
2979 steps :
3080 - name : Checkout
31- uses : actions/checkout@v6
81+ uses : actions/checkout@v7
3282
3383 # Setup .npmrc file to publish to npm
3484 - name : Setup Node.js
3888 registry-url : https://registry.npmjs.org
3989
4090 - name : Install pnpm
41- uses : pnpm/action-setup@v5
91+ uses : pnpm/action-setup@v6
4292
4393 # - name: Get pnpm cache directory path
4494 # id: pnpm-cache-dir-path
0 commit comments