Skip to content

ci: install npm@latest in publish jobs for OIDC Trusted Publishing#18

Merged
walkindude merged 1 commit into
masterfrom
ci/npm-trusted-publishing-bump
May 4, 2026
Merged

ci: install npm@latest in publish jobs for OIDC Trusted Publishing#18
walkindude merged 1 commit into
masterfrom
ci/npm-trusted-publishing-bump

Conversation

@walkindude
Copy link
Copy Markdown
Owner

Summary

The first nightly publish from #17 failed with 404 PUT /cli-bridge — npm's opaque "no valid auth" response. Diagnosis from the run log: actions/setup-node injected its placeholder _authToken=${NODE_AUTH_TOKEN} npmrc, but no real token was provided (we're going OIDC-only) and the npm CLI shipped with Node 22 (10.x) is too old to auto-detect OIDC.

Trusted Publishing OIDC auto-detection lives in npm 11.5.1+. Bundled npm with Node 22 is 10.x, falls back to the registry-url placeholder auth, and gets 404'd.

Fix: npm install -g npm@latest immediately before npm publish in both release jobs. Cheap (single global install, ~1s), keeps the rest of the toolchain on the runner's stable Node 22 default, and is forward-compatible with future npm releases.

Provenance, dist-tag derivation, version stamping, and concurrency control all stayed correct in the failed run — only the upload auth was missing. Re-running with the bump should publish cleanly.

Test plan

  • Merge → master push fires another nightly. Expect cli-bridge@0.1.2-nightly.<date>.<sha> to land on npm with dist-tag=nightly. latest stays at 0.1.2.
  • After success, revoke NPM_TOKEN repo secret (no longer used).

🤖 Generated with Claude Code

Node 22 ships with npm 10.x; npm Trusted Publishing's OIDC
auto-detection lives in npm 11.5.1+. Without it, `npm publish`
falls back to the actions/setup-node placeholder auth in
~/.npmrc and gets 404'd by the registry on upload (npm's
opaque way of saying "no auth").

Bump npm to latest right before publish in both release jobs.
Cheap (one network install) and keeps the rest of the pipeline
on the runner's stable Node 22 toolchain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@walkindude walkindude merged commit 1b87666 into master May 4, 2026
11 checks passed
@walkindude walkindude deleted the ci/npm-trusted-publishing-bump branch May 4, 2026 21:58
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