Skip to content

Fix GoReleaser homebrew publish to use PR flow#3

Merged
kshahbw merged 1 commit intomainfrom
fix/goreleaser-brew-pr-flow
Apr 17, 2026
Merged

Fix GoReleaser homebrew publish to use PR flow#3
kshahbw merged 1 commit intomainfrom
fix/goreleaser-brew-pr-flow

Conversation

@kshahbw
Copy link
Copy Markdown
Contributor

@kshahbw kshahbw commented Apr 17, 2026

Summary

The v0.0.1-beta release failed at the homebrew publish step. Root cause: the brews block in .goreleaser.yml was misconfigured.

What went wrong on the run:

  1. GoReleaser tried to sync a fork that doesn't exist (422 from /merge-upstream).
  2. It then fell back to pushing the formula directly to Bandwidth/homebrew-tap main, which is blocked by branch protection.

The two bugs:

  1. repository.branch wasn't set → GoReleaser defaulted to pushing to main instead of a feature branch. Fixed by setting it to band-{{.Version}}.
  2. pull_request.base.owner and base.name duplicated repository.owner/name → GoReleaser treated this as a cross-repo fork-based PR flow. Removed them so only base.branch: main remains, which triggers the same-repo branch-and-PR flow.

Also named the formula band.rb (via brews[].name: band) so brew install Bandwidth/tap/band resolves — default was cli.rb after the repo name.

Test plan

  • Merge
  • Delete the current v0.0.1-beta tag + GitHub Release, re-tag to re-trigger
  • Confirm GoReleaser creates a band-v0.0.1-beta branch on Bandwidth/homebrew-tap and opens a PR against main
  • Confirm the formula in that PR is named band.rb

The brew publish on v0.0.1-beta failed because GoReleaser was trying
to push the formula directly to homebrew-tap's `main` branch (blocked
by branch protection), then attempted a fork-sync (no fork exists),
then gave up.

Two config bugs:

1. `repository.branch` wasn't set, so GoReleaser defaulted to `main`
   and pushed there instead of creating a feature branch. Set it to
   `band-{{.Version}}` so each release gets its own branch.
2. `pull_request.base.owner` and `base.name` were set to the same
   values as `repository.owner/name`, which makes GoReleaser think
   this is a cross-repo (fork-based) PR flow. Remove them — when
   only `base.branch` is set, GoReleaser uses the same-repo
   branch-and-PR flow, which is what we want here.

Also name the formula `band.rb` explicitly (via `brews[].name: band`)
so `brew install Bandwidth/tap/band` resolves — the default was
`cli.rb` (after the repo name), which didn't match the binary name.
@kshahbw kshahbw requested review from a team as code owners April 17, 2026 18:41
@kshahbw kshahbw merged commit 744349d into main Apr 17, 2026
9 checks passed
@kshahbw kshahbw deleted the fix/goreleaser-brew-pr-flow branch April 17, 2026 18:43
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