Repository navigation
ci: fail release-please when RELEASE_PLEASE_TOKEN is unset - #54
Merged
Merged
Conversation
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.
Problem
PR #52 gave
release-please.ymla trusted token:but
RELEASE_PLEASE_TOKENdid not exist at the time, and the|| github.tokenfallback is silent. That silent fallback is the exact state this repo has been running in for months, and its consequences were only found today:pull_requestruns release-please's token produced came backaction_requiredwhile open andfailurethe moment the PR merged — for chore(main): release 0.1.3 #35, chore(main): release 26.9.0 #39, chore(main): release 2026.9.0 #41, chore(release): add calver aliases for historical releases #42, chore(main): release 2026.9.2 #43. A "merge only if CI passes" rule was unsatisfiable for releases, and nobody could see why.release.yml(goreleaser) last ran on 2026-07-24 forv0.1.1and failed; there have been no runs since. No release fromv0.1.1throughv2026.9.2has a single asset,oci://ghcr.io/echohello-dev/charts/karpenter-provider-hetzner:2026.9.2returns not found, and the GHCR package 404s — whileREADME.mdandDISTRIBUTION.mdboth tell operators to install from there.Root cause (worked out in #52): GitHub does not create normal workflow runs for events produced by
GITHUB_TOKEN— they land in an approval-required state with no jobs. Human and Dependabot PRs were unaffected, which is why the failure was invisible until someone compared run metadata against a passing PR.Fix
Add a first step that fails the job when the secret is unset, with the corrective command in the error message:
The secret now exists (created today), so this is a tripwire for the next regression — a deleted secret, a rename, or a fresh clone of this repo — rather than a fix for a current break.
Trade-off, stated plainly: with this guard, a missing secret stops releases entirely instead of degrading to a half-working state. That is deliberate: a red job with the fix command in its output is strictly better than releases that silently produce nothing, which is what happened here. Dropping back to warn-and-continue is a one-word change (
exit 1→::warning).Not covered: the guard only checks presence. A present-but-expired or revoked token still passes and will fail downstream in release-please itself. Detecting that would mean an API call (
gh api /user) in the guard, which I left out to keep this a pure YAML change.Validation
actionlintclean (v1.7.12).mise run cigreen — lint 0 issues, vet, race tests (including the newtest/e2epackages), build, generate-verify..github/workflows/release-please.ymlonly.