Skip to content

ci: install npm >=11.5.1 so pnpm can do OIDC trusted publishing#18

Merged
indexzero merged 1 commit into
mainfrom
fix/oidc-npm-version
Jun 30, 2026
Merged

ci: install npm >=11.5.1 so pnpm can do OIDC trusted publishing#18
indexzero merged 1 commit into
mainfrom
fix/oidc-npm-version

Conversation

@indexzero

Copy link
Copy Markdown
Owner

Why

Follow-up to #17. That PR got us most of the way: the last Release run authenticated via OIDC and signed provenance to the Sigstore transparency log — but the final PUT https://registry.npmjs.org/vlurp returned E404 Not Found, i.e. pnpm published unauthenticated.

Root cause

changeset publish shells out to pnpm publish, and pnpm delegates the npm OIDC trusted-publishing token exchange to the npm CLI, which must be ≥ 11.5.1 (npm docs; cf. pnpm#9812 → "ensure npm@11 is installed for OIDC publishing").

GitHub's Node 22 runner ships npm 10.x, which can't perform the exchange. Provenance still signed because that uses the GitHub OIDC id-token directly via Sigstore — independent of registry auth — which is why we saw a signed attestation and a 404.

Fix

Add one step before publish:

- name: Upgrade npm for OIDC trusted publishing
  run: npm install -g npm@latest

Result

Merging this runs the Release workflow again. With package.json still at 2.0.0 (npm latest 1.2.0) and no pending changesets, pnpm changeset publish will perform the OIDC exchange via npm >=11.5.1 and publish vlurp@2.0.0 with provenance, then tag v2.0.0.

The 2.0.0 publish reached the registry and signed provenance, but the
final PUT returned E404 — pnpm published unauthenticated.

`changeset publish` invokes `pnpm publish`, and pnpm delegates the npm
OIDC trusted-publishing token exchange to the npm CLI, which must be
>= 11.5.1. GitHub's Node 22 runner ships npm 10.x, which can't perform
the exchange, so no credentials reached the registry. Install npm@latest
before publishing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@indexzero
indexzero merged commit 048fc7a into main Jun 30, 2026
3 checks passed
@indexzero
indexzero deleted the fix/oidc-npm-version branch June 30, 2026 19:40
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