Commit 320a99a
fix(release): support optional PAT for release-please PR creation (#24)
* fix(release): support optional PAT for release-please PR creation
Root cause of all-repo Release Please failures: the default GITHUB_TOKEN
cannot create pull requests when a repository's Settings > Actions >
General > Workflow permissions > "Allow GitHub Actions to create and
approve pull requests" toggle is disabled. release-please-action fails
atomically with:
##[error]release-please failed: GitHub Actions is not permitted to
create or approve pull requests.
Because this happens inside the single manifest run, the already-merged
release commit's tag/GitHub Release is never created either — hence
'gh release list' returning empty even after 'chore(main): release
1.0.0' PRs were merged. The repeated 'commit could not be parsed'
messages for merge-commit and free-text subjects are pre-existing,
non-fatal release-please warnings (excluded from the changelog by
design) — not the cause of failure.
Confirmed via API on autogen, .github, and cas-platform:
can_approve_pull_request_reviews: false
This adds an optional 'release-please-token' secret input to the
reusable workflow, passed through to the action as 'token:', falling
back to github.token when unset. This lets callers opt into a scoped
PAT / GitHub App installation token (which is not subject to the
Actions PR-creation restriction) without requiring the broader,
org-wide 'Allow Actions to create/approve PRs' setting to be enabled.
Backward compatible: no behavior change for existing pinned callers
until they (a) repin to a commit that includes this fix and (b) pass
a token via 'secrets: release-please-token' or 'secrets: inherit'.
* fix(release): pass PAT to release-please self-caller
---------
Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi>1 parent 2f2ed17 commit 320a99a
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
4 | 19 | | |
5 | 20 | | |
6 | 21 | | |
| |||
12 | 27 | | |
13 | 28 | | |
14 | 29 | | |
| 30 | + | |
15 | 31 | | |
16 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
0 commit comments