Skip to content

fix(release): pin npm to 11.5.2 so OIDC trusted publisher works#249

Open
mandarini wants to merge 1 commit into
mainfrom
fix/release-restore-npm-11
Open

fix(release): pin npm to 11.5.2 so OIDC trusted publisher works#249
mandarini wants to merge 1 commit into
mainfrom
fix/release-restore-npm-11

Conversation

@mandarini

@mandarini mandarini commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Re-adds an explicit npm install before the publish step so the workflow runs on npm 11.5.2 (the version that supports OIDC trusted-publisher exchange) instead of Node 22's bundled npm 10.9.x.
  • Adds a multi-line comment in the workflow explaining the dependency, so the line is not deleted again.

Background

The release pipeline has been silently broken since #221 (May 12). That PR removed corepack enable npm && corepack prepare npm@11 --activate with the claim "no longer needed", but actions/setup-node@v6.4.0 does not upgrade npm — Node 22 ships with npm 10.9.x.

npm only learned how to do OIDC trusted-publisher exchange in 11.5.1. On npm 10, npm publish --provenance signs the provenance via sigstore (which works because it uses the GitHub OIDC token directly), then sends the bogus .npmrc placeholder XXXXX-XXXXX-XXXXX-XXXXX as the bearer token to the registry. The registry returns 404 Not Found - PUT https://registry.npmjs.org/@supabase%2fssr (npm registry returns 404 for unauthenticated PUTs to avoid leaking which packages exist).

The repo has no NPM_TOKEN secret configured anywhere — by design, per #221's hardening posture. Auth is OIDC-only via the trusted-publisher binding on npmjs.com. Re-adding a token would weaken that posture, so the fix is to ensure the npm CLI is new enough to use OIDC.

Why this went undetected

Between #221's merge (May 12) and #240's merge (June 4), every release run was for a chore: update @supabase/supabase-js commit. Those have no pending release-please PR, so the workflow's version-determination step took the skip=true branch and never attempted to publish. The first publish attempt on npm 10 — #240's merge on June 4 — failed with E404, as did the two release runs after it (#245, #244).

Failed runs:

Last successful publish: v0.10.3 on May 7 (run 25509681243), which ran on npm 11 via the corepack line that #221 removed.

actions/setup-node ships Node 22 with npm 10.9.x, which has no OIDC
trusted-publisher code path. Without npm >= 11.5.1 the publish step
falls back to the .npmrc placeholder _authToken written by setup-node
(literal "XXXXX-XXXXX-XXXXX-XXXXX") and the registry returns
404 Not Found on PUT.

This regressed in #221 when the corepack-prepare-npm@11 line was
removed with the claim "no longer needed". It went undetected for
~4 weeks because every release run between then and now hit the
skip=true branch (no pending release-please PR on those chore
commits). The regression surfaced once #240, #245, and #244 needed
real publishes — all three release runs failed with the same E404.

The repo has no NPM_TOKEN by design (PR #221 kept OIDC-only auth to
avoid a long-lived token). Re-add a pinned npm bump so the publish
step has a CLI that knows how to do the trusted-publisher exchange.
Comment in the workflow explains the dependency so the line is not
deleted again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mandarini mandarini requested review from a team as code owners June 8, 2026 13:30
@mandarini mandarini self-assigned this Jun 8, 2026
Comment thread .github/workflows/release.yml
@mandarini mandarini requested a review from spydon June 8, 2026 15:41
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.

3 participants