Skip to content

fix(ci): upgrade npm to 11.5.1+ for OIDC trusted publishing#87

Merged
AgentSeal merged 1 commit into
mainfrom
fix/npm-version-for-oidc
Apr 18, 2026
Merged

fix(ci): upgrade npm to 11.5.1+ for OIDC trusted publishing#87
AgentSeal merged 1 commit into
mainfrom
fix/npm-version-for-oidc

Conversation

@AgentSeal

Copy link
Copy Markdown
Collaborator

Summary

First OIDC test publish (v0.7.4-rc.0) failed with npm error 404 on the publish PUT request, even though sigstore provenance signing succeeded. Root cause: Node 22 ships with npm 10.x, which does not support exchanging the GitHub OIDC id-token for a short-lived npm token. The publish step silently fell back to the empty NODE_AUTH_TOKEN written by setup-node.

Fix: one new step that runs npm install -g npm@latest after setup-node and before npm publish. Bumps to npm 11+, which knows how to use OIDC trusted publishing.

Test plan

  • Merge
  • Bump to 0.7.4-rc.1
  • Tag + push, approve deploy
  • Publish succeeds, provenance badge appears on npmjs.com

Node 22 ships with npm 10.x, which does not know how to exchange the
GitHub OIDC id-token for a short-lived npm token. Without this upgrade,
the publish step silently falls back to the empty NODE_AUTH_TOKEN that
setup-node writes to .npmrc, and the registry returns 404.

First test publish (v0.7.4-rc.0) failed at exactly this point, even
though provenance signing via sigstore succeeded, confirming the OIDC
handshake with GitHub was fine and only the npm-side auth was broken.

Fix: `npm install -g npm@latest` before the publish step. Adds ~5s to
runtime.
@AgentSeal AgentSeal merged commit 679363a into main Apr 18, 2026
3 checks passed
@AgentSeal AgentSeal deleted the fix/npm-version-for-oidc branch April 18, 2026 16:36
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.

2 participants