Render the tap tokens the only way goreleaser allows - #11
Merged
Merged
Conversation
The first release run with a working tap PAT (the v0.2.1 retry) failed:
homebrew cask: template: failed to apply
"{{ envOrDefault \"HOMEBREW_TAP_GITHUB_TOKEN\" \"unset\" }}":
function "envOrDefault" not defined
goreleaser renders a repository token through ApplySingleEnvOnly, which
accepts exactly `{{ .Env.NAME }}` (^{{\s*\.Env\.[^.\s}]+\s*}}$) and has no
template functions. envOrDefault went in with #8 and was never exercised: while
the PATs were dead, skip_upload short-circuited the publish before the token was
rendered, so `goreleaser check` and every skipped run passed.
skip_upload keeps envOrDefault — that field goes through the full template
engine, and there an unset variable must still read as "false".
The GitHub assets that retry replaced are intact: all ten match checksums.txt.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJxK2YGapyVchfyE1F8CpR
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.
The v0.2.1 retry, the first run with a working Homebrew/Scoop PAT, failed in GoReleaser:
GoReleaser renders
repository.tokenthroughApplySingleEnvOnly, which accepts exactly{{ .Env.NAME }}and has no template functions.envOrDefaultcame in with #8 and never ran: while the PATs were dead,skip_uploadstopped the publish before the token was rendered, sogoreleaser checkand every skipped run passed.token→{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}/{{ .Env.SCOOP_BUCKET_GITHUB_TOKEN }}skip_uploadkeepsenvOrDefault: that field uses the full template engine, where an unset variable must still read as"false".Verification
goreleaser checkpasses.envOnlyRe(^{{\s*\.Env\.[^.\s}]+\s*}}$).checksums.txt.Follow-up
A retry of v0.2.1 checks out the tag, which still has the broken config, so the taps can only get this fix through a new tag. After merge: tag v0.2.2. It has the same CLI code as v0.2.1.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NJxK2YGapyVchfyE1F8CpR
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.