Skip to content

fix(release): rebase tap clone before push to avoid non-fast-forward#18

Merged
sahil-noon merged 1 commit into
mainfrom
leafy-dunlin
Jun 1, 2026
Merged

fix(release): rebase tap clone before push to avoid non-fast-forward#18
sahil-noon merged 1 commit into
mainfrom
leafy-dunlin

Conversation

@sahil87
Copy link
Copy Markdown
Owner

@sahil87 sahil87 commented Jun 1, 2026

What

Insert git pull --rebase --autostash before the git push in the Update Homebrew tap step of release.yml.

Why

Release run for v0.0.12 failed at the tap-update step:

! [remote rejected] main -> main (cannot lock ref 'refs/heads/main':
   is at 75d6efed... but expected d26fb924...)
error: failed to push some refs

The step did clone → edit formula → commit → push with no reconciliation. When homebrew-tap's main advanced between the clone and the push (concurrent writers to the shared tap repo), git rejected the push as a non-fast-forward — failing the release after the GitHub Release and binaries had already been published.

Fix

Rebase the formula commit onto the current remote tip before pushing. --autostash is defensive (there's nothing dirty in the fresh clone, but it costs nothing).

Notes

  • The failed v0.0.12 run was already re-run and is green; the tap formula is at version "0.0.12". This PR just prevents recurrence.
  • This handles a single collision. If the tap ever sees sustained concurrent writers, a fetch-rebase-retry loop would be the next step — not needed for a single-project tap.
  • Out of scope: a Node 20 → 24 action-deprecation warning surfaced on the same run (actions/checkout, actions/setup-go, action-gh-release). Unrelated to this failure; can be addressed separately.

🤖 Generated with Claude Code

The "Update Homebrew tap" step cloned homebrew-tap, committed the new
formula, and pushed with no reconciliation. When the tap's main advanced
between clone and push (concurrent writers), git rejected the push as a
non-fast-forward, failing the release after the GitHub Release had already
been published.

Insert `git pull --rebase --autostash` before the push so the formula
commit is rebased onto the current remote tip.
@sahil-noon sahil-noon merged commit 070209a into main Jun 1, 2026
1 check passed
@sahil-noon sahil-noon deleted the leafy-dunlin branch June 1, 2026 03:25
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