Repository navigation
ci(release): stage packages on npm for maintainer approval - #104
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sthanikan2000
added this pull request to stack #105
October 9, 2026 15:38
sthanikan2000
removed this pull request from stack #105
October 9, 2026 15:39
release.yml now runs `npm stage publish` instead of `npm publish`. The tarball goes to npm's staging queue and is not installable until a maintainer approves it on npm with 2FA. With the package's trusted publisher limited to `npm stage publish`, CI can no longer make a version live on its own, even if the workflow or an action in it is tampered with. - release.yml: stage instead of publish (the dry run too), assert npm >= 11.15.0 (what `npm stage` needs), and write the stage output and the approve commands to the job summary. - version-bump.yml and README: describe the extra "approve on npm" step. - CONTRIBUTING.md: add "Approving a staged release" and the npm settings a package needs (stage-only trusted publisher, 2FA required, tokens disallowed).
sthanikan2000
force-pushed
the
ci/npm-staged-publishing
branch
from
October 9, 2026 15:53
75cf5dd to
bf75ae5
Compare
5 of 10 tasks
sthanikan2000
added this pull request to stack #106
October 9, 2026 15:55
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.
Summary
Make the npm release a two-key operation.
release.ymlnow stages the package withnpm stage publishinstead of publishing it; the version is not installable until a maintainer approves it on npm with 2FA. With each package's trusted publisher limited tonpm stage publish, the release workflow can't make a version live by itself, even if the workflow, a third-party action in it, or a GitHub session is compromised. The enforcement is on npm's side, outside the repo.It doesn't replace PR review, and npm doesn't document whether the person who staged a version can also approve it, so a different approver is a convention only.
Type of change
Changes made
release.yml:npm publish→npm stage publish(the dry run too). Asserts npm ≥ 11.15.0, whichnpm stageneeds. Writes the command output and the approve commands to the job summary, since the approver needs the stage ID. Exposes the package version as a step output for that summary.version-bump.ymland the README: describe the extra "approve on npm" step.CONTRIBUTING.md, with only the staging docs: Approving a staged release (list, download, approve, reject; inspect the tarball first) and npm settings for a package.Testing
actionlintandprettier --checkare clean (the oneactionlintstyle notice left inversion-bump.ymlis onmainalready)npm view) and carries its provenance badge. The npm docs list--provenancefornpm stage publishbut don't say when the attestation is attached, so this is the main unknownnpm viewshows a staged version (neither is documented)Release notes
N/A. No package changes (
skip-changelog).Rollout order (npm settings, outside this diff)
npm stage publishis always allowed for a trusted publisher, so it works with the current configuration.@opennsw/jsonforms-renderers: Trusted Publisher → Allowed actions → turn offnpm publish, keepnpm stage publish. Doing it before the merge would break the next release, becausemainstill callsnpm publish.@opennsw/auth, register the trusted publisher (repoOpenNSW/ui-packages, workflowrelease.yml) withnpm stage publishonly from the start.Docs used: staged publishing,
npm stage, trusted publishing.