Skip to content

ci(publish): fail-fast preflight gate on release tag/version mismatch#319

Merged
rejifald merged 1 commit into
mainfrom
worktree-release-tag-gate
Jun 21, 2026
Merged

ci(publish): fail-fast preflight gate on release tag/version mismatch#319
rejifald merged 1 commit into
mainfrom
worktree-release-tag-gate

Conversation

@rejifald

Copy link
Copy Markdown
Owner

Why

The 1.0.0-rc.3 publish run failed with:

✗ release tag v1.0.0-rc.3 != package version 1.0.0-rc.2

#318 merged fine (main → rc.3 at 116efe7), but the release tag v1.0.0-rc.3 was cut on the pre-merge commit 9de6ee2 (still rc.2). The guardrail caught it correctly — but only at the publish step, after the full ~15-min verify + e2e gates had already run.

What

  • New preflight job, first in the pipeline, that verify and e2e (and transitively publish-npm) depend on. It compares github.event.release.tag_name to the version in the tagged commit and fails in seconds with an actionable message when they diverge — no install, no build.
  • publish-npm keeps the authoritative check-release --release-tag as defense-in-depth.
  • RELEASING.md updated to document the gate.

Verification

  • YAML parses; job graph is preflight → {verify, e2e} → publish-npm.
  • Gate logic simulated both ways: rc.3-tag-on-rc.2-tree → exit 1; rc.3-tag-on-rc.3-tree → exit 0.
  • prettier --check

Note

This prevents recurrence. To actually ship rc.3, the tag must be re-pointed to the bumped commit and the release re-fired (the 21 new packages are now on npm at rc.2, so the brand-new-name bootstrap blocker is cleared — but their Trusted Publishers must be attached for the OIDC publish to authenticate).

🤖 Generated with Claude Code

The 1.0.0-rc.3 publish failed at the very end with `release tag v1.0.0-rc.3
!= package version 1.0.0-rc.2`: the release tag had been cut on main's
pre-merge tip (rc.2) instead of the merged bump commit (rc.3). The existing
`check-release --release-tag` caught it — but only inside publish-npm, after
the ~15-min verify + e2e gates had already run.

Add a `preflight` job that runs first and gates verify/e2e (and thus publish):
it compares the release tag to the version in the tagged commit and fails in
seconds with a fix-it message when they diverge. The publish job keeps the
authoritative `--release-tag` check as defense-in-depth.

Docs: note the preflight gate in RELEASING.md's CI section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rejifald rejifald merged commit 585478d into main Jun 21, 2026
9 checks passed
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