Repository navigation
release: refuse to release from any branch but main - #5
Merged
Merged
Conversation
Work reaches main when the owner merges it, and releases are cut from main by hand, but nothing enforced the second half. Run from a work branch, release.sh passed every preflight check and would have published unmerged code as "latest". Preflight now fails unless the checked-out branch and the branch the push lands on are both main. A branch that merely tracks main is refused too, since its own commits would otherwise be pushed straight onto it. Ported from WaxOnWaxOff 0ad8fb0. The code and message are the same; the comment drops that repo's reference to its CI gate, which this script does not have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release.shpreflight now stops unless the checked-out branch and the branch the push lands on are bothmain. A work branch, a branch that merely tracksmain, and a detached HEAD are all refused before anything is built or pushed.0ad8fb0. Same code and failure message. The comment differs in one clause: WaxOnWaxOff's says its CI gate would not catch a work-branch release, and this script has no CI gate, so it says instead that nothing else in preflight asks which branch it is releasing from.Testing
zsh -n release.shrelease.sh, run in throwaway repos:maintrackingorigin/main: passesorigin/main: failsmaintrackingorigin/dev: failsrelease.shitself was not run.🤖 Generated with Claude Code