Stage the npm launcher for approval instead of publishing it - #47
Merged
Merged
Conversation
npm's trusted publisher settings advise against letting a workflow run npm publish: allowed only npm stage publish, a release's version waits on npmjs.com until the maintainer approves it with their second factor, so the release job, or anyone who takes over its token, cannot put a version live alone. Staging needs npm 11.15.0 or later, so the job installs npm 11.20.0 rather than take the one Node brings, checks it, and runs npm stage publish with provenance. A notice in the run says the version is waiting for approval. A rerun still skips a version npm has published; one staged and not yet approved stops it, as npm refuses to stage a version twice.
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.
npm's trusted publisher settings advise against letting a workflow run
npm publish: "For stronger security, leave this unchecked to require staged publishing for new versions." The package's trusted publisher now allows onlynpm stage publish, so #46's job would be refused. With this change the release job stages each version, and the version goes live when the maintainer approves it on npmjs.com (the package's Staged Packages) or withnpm stage approve <stage-id>, with their second factor. The release job, or anyone who takes over its OIDC token, can no longer put a version live alone.enginesaccept Node 24) instead of taking the one Node brings, and checks the version before staging.npm stage publish ./npm --access public --provenance; a notice in the run says the version is waiting for approval. A dry run of the same command onnpm/with npm 11.20.0 packed the 4 files and stopped only because 0.30.0 is already published.actionlintpasses; the job first runs on the next tag.