Skip to content

ci(publish-npm): bump to Node 24 to clear npm 11.5.1 floor for OIDC#59

Open
jagguji wants to merge 2 commits intomainfrom
ci/publish-npm-oidc-npm-version-fix
Open

ci(publish-npm): bump to Node 24 to clear npm 11.5.1 floor for OIDC#59
jagguji wants to merge 2 commits intomainfrom
ci/publish-npm-oidc-npm-version-fix

Conversation

@jagguji
Copy link
Copy Markdown
Collaborator

@jagguji jagguji commented Apr 29, 2026

Summary

  • Bump node-version: 2224 in .github/workflows/publish-npm.yml so the runner gets npm 11.12.1+ natively. npm OIDC trusted publishing requires npm CLI >= 11.5.1.
  • The previous npm install -g npm@latest workaround is not safe on the current runner image — see context below.

Why not just upgrade npm in place

Run 24882819896 (the very first OIDC attempt, before f269712) failed at exactly the npm install -g npm@latest step:

npm error code MODULE_NOT_FOUND
npm error Cannot find module 'promise-retry'

That's a known corruption in Node 22.22.2's bundled npm 10.9.7 inside the GitHub-hosted toolcache. Any global npm upgrade hits it. Shubham's f269712 ("removed the global npm installation step") was a real workaround for that crash, not just cleanup — but it left the runner on npm 10.9.7, which fails OIDC publish with E404 on PUT (the registry's stand-in for "this token can't authorize this PUT") because npm 10.x doesn't speak the trusted-publishing token-exchange protocol.

Bumping Node to 24 clears both problems at once:

  • Node 24.15.0 ships npm 11.12.1 (per the Node 24 changelog)
  • No fragile -g upgrade against a corrupted toolcache

What this PR does NOT fix

The trusted-publisher config on npmjs.com was originally registered for @subham_/rescript-blend. Commit 5787894 renamed the package to @juspay/rescript-blend but did not update the npmjs.com side. Even with the npm version fix in this PR, the publish will keep returning 404 on PUT until an admin on the @juspay npm org goes to npmjs.com → package settings and registers a trusted publisher for @juspay/rescript-blend pointing at:

  • repo: juspay/blend-rescript
  • workflow: publish-npm.yml
  • environment: npm

(And likely creates the package under the @juspay scope first, since this would be its inaugural publish under that name.)

Test plan

  • Trigger Publish to NPM with dry_run=true on this branch and confirm npm --version is 11.12.x (>= 11.5.1).
  • Confirm with @juspay npm org admin that the trusted-publisher entry exists for @juspay/rescript-blend.
  • After both are in place and this is merged, run a real publish (dry_run=false) and verify the package appears at @juspay/rescript-blend@0.0.37-beta.2 with --tag beta.

🤖 Generated with Claude Code

jagguji and others added 2 commits April 29, 2026 16:28
Trusted publishing requires npm >= 11.5.1, but Node 22's bundled npm is
10.x. Run 25097941330 failed with E404 on PUT because npm 10.9.7 cannot
exchange the OIDC token for a registry credential and fell back to
anonymous auth. Reinstating the global npm upgrade restores the working
behavior from the original OIDC migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous attempt re-added `npm install -g npm@latest`, but that's exactly
what failed in run 24882819896 with MODULE_NOT_FOUND on promise-retry —
a known corruption of npm 10.9.7 in the Node 22.22.2 runner toolcache
(actions/runner-images#13883). Node 24.x natively ships npm 11.12.1+,
clearing the OIDC trusted-publishing floor (>= 11.5.1) without the
fragile global upgrade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jagguji jagguji changed the title ci(publish-npm): restore npm@latest install for OIDC trusted publishing ci(publish-npm): bump to Node 24 to clear npm 11.5.1 floor for OIDC Apr 29, 2026
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