fix(release): reject stale candidates before publication - #723
Merged
Conversation
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
Stop a stale release before publication instead of adding release credentials. The v0.2.2 run selected a source that became historical while awaiting approval; the built-in token then received HTTP 403 creating its tag after main's workflow files changed.
Immediately before creating a new annotated tag, require the verified source to equal the current default-branch head. If main advanced, exit before tag or versioned Docker publication and tell the maintainer to start a new normal release run. No GitHub App, private key, PAT, or additional configuration is required.
The protected publication job retains contents: write on GITHUB_TOKEN, including all draft reads and verification. The shared tag reconciler preserves existing-tag ownership and exact object checks, same-run continuation, and recovery without moving tags. Candidate verification and the Environment publication gate remain in place.
Limits and recovery
The head check is not an atomic lock: a concurrent main update can still cause GitHub to refuse creation. Existing-tag recovery cannot bypass historical workflow permission restrictions; inspect partial publication on such failure rather than moving tags or overwriting assets. Busy development can require rebuilding candidates from a new main head.
Verification
Architecture and user impact
The release workflow remains the single controller; tag reconciliation is extracted to one script. Documentation describes restart instructions, publication ordering, and recovery limits. No unrelated issue is auto-closed.