Skip to content

revert: restore GITHUB_TOKEN for the release-please action - #287

Merged
kellenmurphy merged 1 commit into
mainfrom
revert/release-please-token
Aug 21, 2026
Merged

revert: restore GITHUB_TOKEN for the release-please action#287
kellenmurphy merged 1 commit into
mainfrom
revert/release-please-token

Conversation

@kellenmurphy

Copy link
Copy Markdown
Owner

Reverts #285, which broke the Release Please workflow on main.

What broke

Passing RELEASE_PLEASE_TOKEN to googleapis/release-please-action made the release PR authored by the same account the approve step runs as. GitHub rejects that:

failed to create review: GraphQL: Review Can not approve your own pull request (addPullRequestReview)

The step runs under bash -e, so it aborted there and never reached gh pr merge --auto. Release PR #286 is consequently open, CI-green, but unapproved and without auto-merge.

Why GITHUB_TOKEN was correct

It is deliberate, and the two identities are the point:

  • the action creates the release PR as the bot
  • RELEASE_PLEASE_TOKEN then approves it as a distinct identity, which GitHub permits

CI already triggers without the swap

ci.yml listens for labeled in its pull_request types, and the release-please job adds a trigger-ci label using GH_TOKEN: RELEASE_PLEASE_TOKEN. Because that label is applied by a real user PAT rather than GITHUB_TOKEN, the event fires normally. #286 shows this working: Build & Test ran and passed.

So the token swap solved a problem that the label mechanism had already solved, at the cost of breaking approval.

After this merges

#286 still needs a manual approve and merge to ship 1.5.8, since its auto-merge was never enabled. Subsequent releases should self-handle again.

Reverts #285. Passing RELEASE_PLEASE_TOKEN to the action made the release
PR authored by the same account that the approve step runs as, so
`gh pr review --approve` failed with "Can not approve your own pull
request" and the step aborted before enabling auto-merge.

GITHUB_TOKEN on the action is deliberate: it makes the release PR authored
by the bot, leaving RELEASE_PLEASE_TOKEN a distinct identity that is
allowed to approve it. CI on the release PR is already triggered by the
trigger-ci label, which ci.yml picks up via its `labeled` event type, so
the token swap was not needed for that.
@kellenmurphy
kellenmurphy enabled auto-merge (squash) August 21, 2026 17:34
@kellenmurphy
kellenmurphy merged commit 568b458 into main Aug 21, 2026
10 checks passed
@kellenmurphy
kellenmurphy deleted the revert/release-please-token branch August 21, 2026 17:35
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant