Skip to content

🤖 fix: render GoReleaser channel templates when GORELEASER_CHANNEL is unset - #138

Merged
ThomasK33 merged 1 commit into
mainfrom
fix/goreleaser-release-channel
Sep 25, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
fix/goreleaser-release-channel

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

What broke

The v0.1.1 release build (run) failed before publishing anything:

template: failed to apply "{{ eq .Env.GORELEASER_CHANNEL \"main\" }}": map has no entry for key "GORELEASER_CHANNEL"

release.yaml never sets GORELEASER_CHANNEL, and GoReleaser rejects a template that reads a missing .Env key. The changelog template already used index .Env; the release.disable and both dockers_v2 disable templates did not. No binaries, archives or images were published for v0.1.1.

Fix

  • .goreleaser.yaml: read the channel with index .Env "GORELEASER_CHANNEL" in all three templates.
  • .github/workflows/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 the main, empty, release and unset channels, and checks which pipes run on each (release and the release image off only on main; the :main image on only on main).

Validation

  • The new test fails on the v0.1.1 config with the same map has no entry error, and passes on this PR.
  • make verify-vendor, make build, make lint, make test and actionlint pass.
  • A local goreleaser release --clean --skip=announce,publish cannot 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.

The channel test passes on this PR and fails with the v0.1.1 config

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

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T08:10:58.379239Z d631f6b PR opened
🔒 Security Review ✅ Completed 2026-09-25T08:14:22.544026Z d631f6b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: d631f6b3aa

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit c9ffd94 Sep 25, 2026
10 checks passed
@ThomasK33
ThomasK33 deleted the fix/goreleaser-release-channel branch September 25, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant