Skip to content

ci(publish): run the version guard on workflow_dispatch too - #13

Merged
edridudi merged 1 commit into
mainfrom
ci/dispatch-version-guard
Sep 24, 2026
Merged

edridudi merged 1 commit into
mainfrom
ci/dispatch-version-guard

Conversation

@edridudi

Copy link
Copy Markdown
Member

The tag/pom cross-check added in #12 was gated on startsWith(github.ref, 'refs/tags/v'). On a workflow_dispatch run, github.ref is 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.ref on dispatch, ref_name on 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:

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

🤖 Generated with Claude Code

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>
@edridudi
edridudi merged commit f20f597 into main Sep 24, 2026
1 check passed
@edridudi
edridudi deleted the ci/dispatch-version-guard branch September 24, 2026 09:00
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.

1 participant