ci: run the publish gate on release, not on the version PR - #349
Merged
Conversation
The gate was a job on the changesets "Version Packages" PR, conditional on `startsWith(github.head_ref, 'changeset-release/')`. That PR is opened with the built-in GITHUB_TOKEN, and GitHub does not trigger `on: pull_request` workflows for such a PR, so it carries zero checks and the gate has never run. Move it into `release.yml` as a `needs:` of the release job, where it runs on the default branch immediately before `changeset publish`. The gate is self-contained — it packs the working tree and diffs that against the registry — so it needs no PR context. This also means it runs on pushes that only open or update the Version PR rather than publish. That is deliberate: it fails closed, and surfaces a bad tarball one merge earlier. Requires cyberuni/.github's matching gate fix to land first, or the gate inspects nothing on single-package repos. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RLRX3QtRpgCfDt16KShQC
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #349 +/- ##
=======================================
Coverage 96.35% 96.35%
=======================================
Files 24 24
Lines 357 357
Branches 63 63
=======================================
Hits 344 344
Misses 13 13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 publish gate was a job on the changesets "Version Packages" PR, conditional on
startsWith(github.head_ref, 'changeset-release/'). That PR is opened with the built-inGITHUB_TOKEN, and GitHub does not triggeron: pull_requestworkflows for a PR created by that token — so it carries zero checks and the gate has never run, once, on this repo.This moves it into
release.ymlas aneeds:of the release job, where it runs onmainimmediately beforechangeset publish. The gate is self-contained — it packs the working tree and diffs that against the registry — so it needs no PR context.What this does not change
The Version PR still merges by admin override, exactly as today. Nothing here makes anything auto-mergeable, and no auto-merge is armed.
Fails closed
Because it is a
needs:of release, the gate also runs on pushes that only open or update the Version PR rather than publish. That is deliberate — a bad tarball surfaces one merge earlier.Why the other options were rejected
changeset-release/*from the ruleset: impossible. Rulesets key on the target ref (main); there is no head-branch condition in the API.GITHUB_TOKEN: blocked by the same restriction; GitHub's docs use exactly this as the illustrative example.code / all-checkscommit status: "if a check and a commit status have the same name, both must pass when that name is required" — a deadlock, not a fix.Depends on
cyberuni/.github#19 must land first. Without it the gate inspects nothing on single-package repos.
🤖 Generated with Claude Code
https://claude.ai/code/session_014RLRX3QtRpgCfDt16KShQC