Open
Conversation
Adds staged publishing support with subcommands: publish, list, view, approve, reject, and download. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Why would download not require 2fa but view require it? Either both should, or neither, I’d expect. |
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.
Introducing
npm stage🎉A new command for staged publishing — allowing package maintainers to decouple the act of publishing from proof-of-presence (2FA), making automated workflows more secure.
🔗 Docs
Why Staged Publishing?
With
npm stage publish, an automated workflow can stage a package version without a 2FA prompt. The maintainer can then review and approve the staged package at their convenience, providing 2FA only at the approval step. This keeps proof-of-presence in the loop while keeping CI/CD fully automated.Subcommands
npm stage publish [<package-spec>]npm stage list [<package-spec>]npm stage view <stage-id>npm stage approve <stage-id>npm stage reject <stage-id>npm stage download <stage-id>How It Works
npm stage publishusing any token type (no 2FA needed). The package version is held in a pending state, not publicly available.npm stage listto see pending staged packages, andnpm stage view <id>ornpm stage download <id>to inspect them.npm stage approve <id>(with 2FA) to publish, ornpm stage reject <id>to discard.Key Behaviors
npm publishcontinues to work alongside staged publishing.npm stage publishhas full parity withnpm publish(respects"private": true, workspace support, etc).Future Work
npm trust, with--allow-publishand--allow-stage-publishflags to control whether a trust relationship can be used fornpm publish,npm stage publish, or both.