fix(ci): drop registry-url so OIDC trusted publishing engages - #8
Conversation
Root cause of the 404 publish failures:
setup-node@v4 with `registry-url` writes ~/.npmrc with:
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
With no NODE_AUTH_TOKEN secret (we use OIDC, not tokens), npm reads an
empty bearer from .npmrc and sends it to publish → 404 Not Found. npm
never falls through to the OIDC token that's sitting right there.
Removing registry-url means no .npmrc is written, so npm finds the
GitHub OIDC env vars (ACTIONS_ID_TOKEN_REQUEST_URL/TOKEN, confirmed
present via debug step) and uses them. Trusted publishing engages
correctly and the package publishes with automatic provenance.
Verified id-token: write is granted (the GITHUB_TOKEN permissions log
just doesn't display it explicitly; the OIDC env vars confirm).
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR modifies the release workflow to remove explicit npm registry URL configuration from Node.js setup, enabling GitHub OIDC trusted publishing for npm authentication instead of environment variable-based token management. ChangesCI/CD npm authentication setup
Possibly related PRs
Poem
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Root cause
setup-node@v4withregistry-urlwrites~/.npmrccontaining:We deliberately have no
NODE_AUTH_TOKENsecret (OIDC trusted publishing replaces tokens). npm reads "empty bearer token" from .npmrc, sends it to npmjs.org → 404 Not Found before ever trying OIDC.Verification (via debug step on the same branch)
So
id-token: writewas always being granted correctly; the GITHUB_TOKEN permissions log just doesn't display it. The blocker was npm preferring the empty_authTokenover OIDC.Fix
One line: drop
registry-urlfrom the publish job'ssetup-node. npm defaults toregistry.npmjs.organyway, and with no .npmrc auth config it finds and uses the OIDC token automatically.After merge
The push will trigger another publish run. Expected outcome: v1.0.8 lands on npm with the green "Built and signed on GitHub Actions" provenance badge, plus a
v1.0.8git tag and GitHub release. If something else is wrong, the error message should now be specific to OIDC/trust (not a generic 404).🤖 Generated with Claude Code
Summary by CodeRabbit