Repository navigation
ci(publish): run the version guard on workflow_dispatch too - #13
Merged
Merged
Conversation
The tag/pom cross-check was gated on startsWith(github.ref, 'refs/tags/v'), but workflow_dispatch sets github.ref to the branch holding the workflow file (refs/heads/main) regardless of which ref is checked out. The guard therefore skipped on every dispatch - the exact path used to re-drive a failed release, and the one most likely to be pointed at the wrong ref under pressure. Observed on the v1.4.0 re-run, where the step reported "skipped". Now reads the ref that was actually built (inputs.ref on dispatch, ref_name on a tag push) and compares on both triggers. A ref that makes no version claim - a SHA or a branch name - skips the comparison and says which pom version it is about to publish, rather than failing on something it cannot check. Verified against the ref shapes that reach this workflow: v1.4.0 -> claims 1.4.0, pom 1.4.0 => pass v1.3.0 -> claims 1.3.0, pom 1.4.0 => blocked v2.0.0-rc1 -> claims 2.0.0-rc1, pom 1.4.0 => blocked 4660c7d / main -> no claim, cross-check skipped Co-Authored-By: Claude Opus 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.
The tag/pom cross-check added in #12 was gated on
startsWith(github.ref, 'refs/tags/v'). On aworkflow_dispatchrun,github.refis the branch holding the workflow file (refs/heads/main) no matter which ref is checked out — so the guard skipped on every dispatch.Observed live on the v1.4.0 re-run: the step reported
skipped. That is the path used to re-drive a failed release, and the one most likely to be pointed at the wrong ref under pressure — so the guard was missing precisely where it was most needed.Now reads the ref that was actually built (
inputs.refon dispatch,ref_nameon a tag push) and compares on both triggers. A ref carrying no version claim — a SHA or branch name — skips the comparison and reports which pom version it is about to publish, rather than failing on something it cannot check.Verified against the ref shapes that reach this workflow:
🤖 Generated with Claude Code