Repository navigation
Conversation
…sion The trigger was release:created. GitHub fires created when a draft release is saved, which would publish from the default branch before the tag exists; it then fires published (not created) when that draft is released, so the real release would ship nothing. Every release so far was created and published in one action, which is why this never bit. The job also published whatever version happened to be in package.json at the release commit, so a tag and a version could disagree silently. A guard now compares them and fails the job. publishConfig.registry pins GitHub Packages. CI worked only because setup-node writes the runner .npmrc; a local npm publish would target npmjs.org and fail against a scope we do not own. Lint and build join the pre-publish test gate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
Superseded by #23, which carries these commits unchanged. Splitting this into separate reviews added overhead without adding safety. |
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.
Batch 3 of the review findings. Workflow and packaging only — no source changes.
The trigger was wrong for drafts
on: release: types: [created]. GitHub's semantics:createdfires when a draft release is saved → publishes from the default branch, before the tag existspublishedfires when a draft is released → the current workflow does not run, so the real release ships nothingEvery release so far was created and published in one action, which is why it has worked:
One click on "Save draft" breaks it in both directions. Now
types: [published].Tag and version could disagree silently
The job published whatever
package.json.versionwas at the release commit, regardless of the tag. A mismatch either 409s confusingly (duplicate version) or publishes a number nobody will find.A guard now compares them:
The tag is passed through
env:rather than interpolated into the script, so there is no injection surface even thoughrelease.tag_nameis attacker-influenceable in principle.publishConfig.registryAbsent. CI publishes correctly only because
setup-node'sregistry-urlwrites the runner.npmrc. A maintainer runningnpm publishlocally would target npmjs.org, build viaprepublishOnly, then fail against a scope we do not own. Now pinned to GitHub Packages.Also
lintandbuildjointestin the pre-publish gate, matchingtest.yml.Verification
All three workflows parse as valid YAML with the expected triggers; the publish steps parse as shell; the guard was exercised both ways. Nothing here changes the package contents —
pnpm install --frozen-lockfilestill succeeds and the source is untouched.Cannot be end-to-end tested without cutting a real release, which is the nature of a publish workflow. That is also why the
--provenanceidea stayed out earlier: GitHub Packages rejects attestations, and the publish job is the one place a mistake is expensive.