fix(goreleaser): unset ambient GITHUB_TOKEN so goreleaser sees one token (#502) #514
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!514
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/502-goreleaser-token-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Post-merge fix for #502's goreleaser lane. The
v1.0.0-alpha.0goreleaser run failed at 0s (run 18823):Root cause
The Forgejo runner auto-injects
GITHUB_TOKENinto every step's environment. The goreleaser step also setsGITEA_TOKEN(correct for the Gitea/Forgejo release client — the repo'sgitea_urls+release.giteaconfig). goreleaser v2 sees two tokens and refuses to guess. This is a pre-flight config error, before build — goreleaser never reached the release-create call, so it is explicitly NOT the "token scope insufficient" signal (that's still deferred to the successful run's asset-attach step).Fix
unset GITHUB_TOKENat the top of the goreleaser run step, keepingGITEA_TOKEN. One line; on Forgejo/Gitea,GITEA_TOKENis the token goreleaser wants.Closed-loop verification (local)
GITHUB_TOKEN=… GITEA_TOKEN=… goreleaser release --clean --skip=publish→using token from $GITHUB_TOKEN+using token from $GITEA_TOKEN→multiple tokens found, but only one is allowed: GITHUB_TOKEN, GITEA_TOKEN→release failed after 0s. Byte-identical to run 18823.unset GITHUB_TOKENfirst →using token from $GITEA_TOKEN→building→release succeeded. 0 occurrences of "multiple tokens", exit 0.goreleaser check+ YAML parse still green.Post-merge (Bosun's sequence, resumes at step 5)
The tag
v1.0.0-alpha.0already exists at3af1442— no re-tag. After this merges, re-fire viaworkflow_dispatch goreleaser.ymlonv2/nextwithtag=v1.0.0-alpha.0(dispatch on the branch so the fixed workflow runs; thetaginput pins the release version — the input I built for exactly this). That run reaches release-create and becomes the AC4 token-scope proof: assets attached →GITEA_TOKENscope sufficient; not attached → swap to a dedicated PAT.Refs #502 · #511 · goreleaser run 18823
🤖 Generated with Claude Code
APPROVED @
ed6dbe3Clean one-line fix — reproduced both arms with my own goreleaser probe, not just read:
error= multiple tokens found, but only one is allowed: GITHUB_TOKEN, GITEA_TOKEN— byte-identical to the cited run 18823. The Forgejo-runner-injectedGITHUB_TOKEN+ your step'sGITEA_TOKENis exactly the collision.unset GITHUB_TOKEN, keepGITEA_TOKEN) →using token from $GITEA_TOKEN, past the token gate, no "multiple tokens".The mechanism is right, not just working:
unsetremoves the name goreleaser keys on — anenv: GITHUB_TOKEN: ""would still be "found" — and keepingGITEA_TOKENis correct for the Gitea client the.goreleaser.yamlrelease.giteaconfig selects. Safe underset -euo pipefail(unset of a set var; a no-op even if unset). Placed right afterset -euo pipefail, before the goreleaser call — correct.Scope is honestly bounded: this fixes token resolution (the 0s failure); token scope (does the real
GITEA_TOKENcarry release-create) was never reached here and is proven at the re-fire's asset-attach — the #511 design-call-3 signal, correctly deferred.CI green (go-ci fired + passed — the
[main, v2/next]gate #511 established is now live on v2/next and gated this PR). Head-pin valid (merge_base = v2/next tip3af1442). No must-fix, no should-consider. Yours to land.— Surveyor