Skip to content

Skip the Homebrew tap upload when HOMEBREW_TAP_GITHUB_TOKEN is not set - #45

Merged
novatechflow merged 1 commit into
mainfrom
fix/homebrew-token-optional
Oct 22, 2026
Merged

novatechflow merged 1 commit into
mainfrom
fix/homebrew-token-optional

Conversation

@novatechflow

Copy link
Copy Markdown
Member

The v1.1.1 release published its GitHub release and assets, but goreleaser then failed at the Homebrew step because HOMEBREW_TAP_GITHUB_TOKEN is not set. The template {{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }} fails when the key is missing.

  • Read the token with index .Env, so a missing key renders empty instead of failing.
  • Set skip_upload when the token is empty, so the formula is still generated but not pushed to the tap.
  • Pass HOMEBREW_TAP_GITHUB_TOKEN from repository secrets to goreleaser, so the tap upload works once the secret is added.

Validation with goreleaser v2.18.3 (the version CI used) and the variable unset:

  • goreleaser release --snapshot --clean --skip=sign succeeds.
  • A local non-snapshot release from a throwaway copy with a local tag, release disabled and an invalid GitHub token fails with the old config with the same error as CI, and succeeds with this change: "brew.skip_upload is set".
  • goreleaser check reports only the existing brews deprecation warning.

A snapshot step in CI would not catch this, because snapshot mode skips the publish stage where the error happens; it passes with the old config too. So no CI step is added.

Unit tests pass apart from the DNS tests that need a resolver which fails unknown hosts; the sandbox resolves every name. CI runs them normally.

@novatechflow
novatechflow merged commit 14dce7b into main Oct 22, 2026
2 checks passed
@novatechflow
novatechflow deleted the fix/homebrew-token-optional branch October 22, 2026 09:36
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