Skip to content

ci(release): upgrade npm to latest for OIDC token exchange#9

Merged
faraa2m merged 1 commit into
mainfrom
fix/upgrade-npm-for-oidc
May 12, 2026
Merged

ci(release): upgrade npm to latest for OIDC token exchange#9
faraa2m merged 1 commit into
mainfrom
fix/upgrade-npm-for-oidc

Conversation

@faraa2m
Copy link
Copy Markdown
Owner

@faraa2m faraa2m commented May 12, 2026

Why this is needed

Trusted Publisher OIDC migration in #8 landed, but publishes still 404. Root cause: npm CLI version on the runner.

Node 20 ships npm 10.x. With OIDC trusted-publisher, npm 10.x can sign provenance attestations (the workflow log shows successful signing to sigstore log index 1515879049) but cannot exchange the GitHub-issued OIDC token for a publish credential. The PUT to the registry returns a misleading 404 `'@routerlab/core@0.0.2' is not in this registry` — npm hides the auth state.

npm Trusted Publishing requires CLI version >= 11.5.1.

Fix

Add a single `npm install -g npm@latest` step after `actions/setup-node@v4`. Lightweight; runs in <5s on the cached runner.

Test plan

After merge, the next changeset-driven release will:

  • Setup Node 20 (npm 10.x)
  • Upgrade to npm latest (11.x+)
  • Exchange OIDC token via npm CLI's trusted-publisher flow
  • PUT to registry succeeds with provenance attestation

Node 20 ships npm 10.x. With the trusted-publisher OIDC migration in
PR #8 landed, `npm publish` can sign provenance but cannot exchange
the GitHub-issued OIDC token for an npm publish credential — registry
returns a misleading 404 ("'@routerlab/core@0.0.2' is not in this
registry") even though the package and the binding both exist.

Adding `npm install -g npm@latest` after setup-node@v4 bumps to
npm >= 11.5.1 which supports the OIDC publishing flow. Smallest
possible fix; no other workflow changes.

Reference: npm blog post on trusted publishing requires npm 11.5.1+.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@faraa2m faraa2m merged commit 23741d3 into main May 12, 2026
1 check passed
@faraa2m faraa2m deleted the fix/upgrade-npm-for-oidc branch May 12, 2026 05:14
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