Add ref input and enforce main-only stable releases#51
Merged
Conversation
Add a `ref` text field to the Release workflow so users can specify which branch to build from without using the branch dropdown. Enforce that stable versions (X.Y.Z) can only be released from main — non-main branches require a prerelease version (e.g. X.Y.Z-alpha.1).
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
reftext field to the Release workflow dispatch form so users can type a branch name to release from, instead of using the branch dropdownX.Y.Z) can only be released frommain— non-main branches require a prerelease version (X.Y.Z-alpha.1, etc.)refinput and the existing branch dropdown (backward compatible)run-nameto show the version and ref in the workflow run listHow it works
effectiveRef()resolves the target branch fromrefinput (if set) or the dispatch branchvalidateDispatch()rejects stable versions when the effective ref isn'tmaintagAndDispatch()resolves HEAD for tagging when a custom ref is used (sincegithub.shabelongs to the dispatch branch, not the checked-out ref)assertCheckoutSha/assertOriginMainShaare skipped for custom refs (they compare againstgithub.shawhich doesn't apply)Test plan
ref=<branch>and a prerelease version — should succeedref=<branch>and a stable version — should fail validation