Repository navigation
fix(ci): run CI on release-please PRs with trusted token - #52
Merged
Merged
Conversation
release-please-action opens and updates the release PR with the default GITHUB_TOKEN. Per GitHub docs, pull_request events produced by GITHUB_TOKEN create workflow runs in an approval-required state only: CI on every release PR sits at 'awaiting approval from a maintainer' with zero jobs and is dismissed as failure when the PR merges (or after ~30 days). Pass an optional RELEASE_PLEASE_TOKEN (PAT or GitHub App token) so release PRs are authored by a trusted identity and CI runs automatically. Falls back to github.token when the secret is absent, so behaviour is unchanged until the secret is configured. Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
johnnyhuy
marked this pull request as ready for review
October 3, 2026 12:14
johnnyhuy
added a commit
that referenced
this pull request
Oct 6, 2026
The token line added in #52 falls back to github.token when the secret is missing, which is exactly the state that shipped no releases: events from GITHUB_TOKEN get approval-gated runs with zero jobs on the PR, and the release event never fires, so goreleaser never ran. That degradation was silent for months. A first step now fails the job with the fix command in the error, so a deleted or renamed secret is visible immediately. Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
CI never executes on release-please PRs because
release-please.ymlrunsgoogleapis/release-please-action@v4with the defaultGITHUB_TOKEN. GitHub treatspull_requestevents produced byGITHUB_TOKENspecially: "when a workflow usingGITHUB_TOKENcreates or updates a pull request, the resultingpull_requestevent creates workflow runs in an approval-required state ... a user with write access to the repository can start the runs by selecting Approve workflows to run" (GitHub docs: Triggering a workflow). Every CI run for a PR opened/updated bygithub-actions[bot]therefore lands with zero jobs and the banner "This workflow is awaiting approval from a maintainer in #N" (verified in run 36433648525, PR #47). Nobody clicks Approve; the release PRs are merged seconds later, which dismisses the held run asfailurewith zero jobs and no logs (runs left unmerged expire ~30 days later: 30577984653 / 30578760010 / 30579654886 from 2026-07-30 all concludedfailureon 2026-08-29). Human PRs (johnnyhuy,MEMBER) and Dependabot PRs are not created viaGITHUB_TOKEN, so their runs execute normally (6 jobs). The CI workflow itself is not at fault:ci.ymlis byte-identical on the release branches andmain, has nopathsor job-levelif:filters, and repo Actions policy isallowed_actions: all.Evidence
action_requiredfailurefailurefailurefailuresuccessFix in this PR
One line in
.github/workflows/release-please.yml: pass an optionalRELEASE_PLEASE_TOKENto the action, falling back togithub.tokenwhen the secret is absent (behaviour is unchanged until the secret exists). With the secret set, release PRs are authored by a trusted identity andpull_requestworkflows run automatically without the approval prompt (GitHub docs: "Using one of these alternatives [GitHub App installation access token or a personal access token] also letspull_requestworkflows run automatically (without the approval prompt described above) when the pull request is created or updated by automation"; see also release-please-action: Token).Maintainer action required to activate the fix:
release-please-config.jsononly touchesCHANGELOG.md,.release-please-manifest.jsonandpkg/version/version.go, soworkflowswrite is not needed.)RELEASE_PLEASE_TOKEN(Settings → Secrets and variables → Actions).The token owner must have write access so the PR author association is
MEMBER/COLLABORATOR(as with human PRs today). Thegithub.tokenfallback keeps release automation working if the secret is ever removed.Immediate unblock for the open release PR (#47)
Open the workflow run or the PR merge box and click Approve workflows to run — the six CI jobs will then execute. That is the manual workaround for every release PR until the secret exists.
Related consequence of the same root cause
Releases published by
github-actions[bot](v0.1.2, v0.1.3, v2026.9.0, v2026.9.2) never triggeredrelease.ymleither:releaseevents produced byGITHUB_TOKENare suppressed ("workflows normally triggered byrelease.createdevents will also not run"). Only v0.1.1 (published byjohnnyhuy) ever ran the Release workflow. The token change fixes that path as well.Validation
actionlintpasses; YAML round-trip confirmstoken: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}.gh run list --branch ci/release-pr-checks), confirming trigger config is untouched.Deliberately not done:
pull_request_target,workflow_runauto-approve of the gate, or any change that weakens/skips checks for all PRs.