Skip to content

ci(npm): stage releases for 2FA approval instead of publishing - #138

Merged
pegahcarter merged 1 commit into
mainfrom
ci/npm-stage-publish
Nov 11, 2026
Merged

pegahcarter merged 1 commit into
mainfrom
ci/npm-stage-publish

Conversation

@pegahcarter

Copy link
Copy Markdown
Contributor

Why

The first release run, 43067043208 for tag npm-v0.1.0, failed at npm publish with 403 OIDC permission denied for this action. The OIDC exchange worked, and npm signed and logged the provenance statement. The refusal came from the trusted publisher's allowed actions. npm stage publish is always allowed. A direct npm publish needs its own permission, and npm's docs say records created after Sep 3, 2026 default to stage-only.

What

The publish job now runs npm stage publish . --access public instead of npm publish. A staged version stays hidden until a maintainer approves it on npmjs.com with 2FA. A release therefore needs two approvals: the npm GitHub environment, and the npm maintainer's 2FA review. A compromised workflow run cannot release on its own.

Staged publishing needs npm 11.15.0 or later, and the job already pins 11.21.1.

Checked

npm@11.21.1 stage publish . --access public --dry-run from contracts/evm/npm stages @crossecute/protocol@0.1.0 with the same shasum, 0f731243b055a550043bffe0f28deb02eb008744, as the failed run.

After merging

Move npm-v0.1.0 to the merge commit. A rerun of the failed job would use the workflow at the tag's old commit. Then approve the job, then approve the staged version on npmjs.com. npm requires a trusted publisher's first successful publish within 2 days of its creation.

The trusted publisher allows npm stage publish only, which refused the
first release's direct publish with a 403. A staged version stays hidden
until a maintainer approves it on npmjs.com with 2FA.
@pegahcarter
pegahcarter merged commit 045e224 into main Nov 11, 2026
3 checks passed
@pegahcarter
pegahcarter deleted the ci/npm-stage-publish branch November 11, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant