Skip to content

Fix Release job: skip Homebrew tap publish when HOMEBREW_TAP_TOKEN is absent - #54

Closed
kriserickson with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-release-job-failure
Closed

Fix Release job: skip Homebrew tap publish when HOMEBREW_TAP_TOKEN is absent#54
kriserickson with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-release-job-failure

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The Release job was failing because GoReleaser attempted to push the Homebrew formula to kriserickson/homebrew-tap using a missing or expired HOMEBREW_TAP_TOKEN, returning a 401 even after binaries were successfully uploaded to GitHub Releases.

Change

Added a skip template to the brews publisher in .goreleaser.yaml that explicitly evaluates to "false" (publish) when the token is present and "true" (skip) when it is not:

brews:
  - repository:
      owner: kriserickson
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
    skip: '{{ if .Env.HOMEBREW_TAP_TOKEN }}false{{ else }}true{{ end }}'

The explicit false/true string values are required — GoReleaser parses the rendered output as a boolean, so an empty string (the natural result of {{ if ... }}true{{ end }} when the condition is false) is ambiguous. This keeps Homebrew publishing fully functional when the token is configured while preventing a hard failure when it is not.

… is missing

The Release job was failing because GoReleaser tried to publish a Homebrew
formula to kriserickson/homebrew-tap, but HOMEBREW_TAP_TOKEN was either
missing or expired, resulting in a 401 Bad credentials error.

Add a skip condition to the brews section in .goreleaser.yaml so the
Homebrew tap step is gracefully skipped when the token is not available.
The template explicitly returns 'false' (publish) or 'true' (skip) to
ensure GoReleaser parses the boolean correctly.
Copilot AI changed the title [WIP] Fix failing GitHub Actions job "Release" Fix Release job: skip Homebrew tap publish when HOMEBREW_TAP_TOKEN is absent Jul 21, 2026
Copilot AI requested a review from kriserickson July 21, 2026 17:42
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.

2 participants