🤖 fix: render GoReleaser channel templates when GORELEASER_CHANNEL is unset - #138
Merged
Merged
Conversation
…nset
The v0.1.1 release build failed before publishing anything:
'template: failed to apply "{{ eq .Env.GORELEASER_CHANNEL "main" }}": map
has no entry for key "GORELEASER_CHANNEL"'. The release workflow never
sets GORELEASER_CHANNEL, and GoReleaser rejects a template that reads a
missing .Env key. The changelog template already used index .Env; the
release and dockers_v2 disable templates did not.
- .goreleaser.yaml: read the channel with index .Env in all three
templates.
- release.yaml: set GORELEASER_CHANNEL=release explicitly.
- hack/main_publish_test.go: TestReleaseAndImageChannels renders the
release and both dockers_v2 disable templates with missingkey=error for
main, empty, release and unset channels, and checks which pipes run.
It fails on the old config with the same "map has no entry" error.
Signed-off-by: Thomas Kosiewski <tk@coder.com>
---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `medium`_
Change-Id: Id1d8ac1debbd39f9690857d9b075c2545c311ec0
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
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.
What broke
The v0.1.1 release build (run) failed before publishing anything:
release.yamlnever setsGORELEASER_CHANNEL, and GoReleaser rejects a template that reads a missing.Envkey. The changelog template already usedindex .Env; therelease.disableand bothdockers_v2disabletemplates did not. No binaries, archives or images were published for v0.1.1.Fix
.goreleaser.yaml: read the channel withindex .Env "GORELEASER_CHANNEL"in all three templates..github/workflows/release.yaml: setGORELEASER_CHANNEL: releaseexplicitly.hack/main_publish_test.go:TestReleaseAndImageChannelsrenders the release and bothdockers_v2disable templates withmissingkey=errorfor themain, empty,releaseand unset channels, and checks which pipes run on each (release and the release image off only onmain; the:mainimage on only onmain).Validation
map has no entryerror, and passes on this PR.make verify-vendor,make build,make lint,make testand actionlint pass.goreleaser release --clean --skip=announce,publishcannot reproduce the failure: the release and image pipes it fails in are skipped when publishing is skipped. The unit test is the gate for those templates. The real check is the next release run.Terminal recording (vhs capture; timing approximate):
rc-demo.webm
After this lands
Cut v0.1.2 from
main. The v0.1.1 tag stays: its source already contains #136, but it has no release artifacts.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:medium• Cost:$1754.57