fix(ci): drop registry-url from setup-node so wasm publish uses OIDC#2235
Conversation
The publish step failed with a confusing 404 from registry.npmjs.org
because actions/setup-node@v4 with registry-url auto-writes
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
always-auth=true
into .npmrc. With NODE_AUTH_TOKEN unset (we removed it for Trusted
Publishing) npm sends an empty bearer token instead of falling back
to OIDC, and the registry rejects it as 404 / no permission.
Per npm's Trusted Publishing guidance, npm publish should run with
no token or _authToken settings. Drop registry-url so setup-node
leaves .npmrc untouched and npm can negotiate OIDC.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe GitHub Actions workflow for publishing Wren Core WASM is updated to remove explicit npm registry authentication configuration and pin Node.js to version 24, relying instead on OIDC-based Trusted Publishing without auto-writing ChangesCI Workflow Authentication Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
After #2232 the wasm publish job still failed with:
```
npm warn Unknown user config "always-auth". This will stop working in the next major version of npm.
```
Root cause
actions/setup-node@v4withregistry-url: https://registry.npmjs.orgwrites an.npmrccontaining:After we removed
NODE_AUTH_TOKENfor Trusted Publishing, the placeholder interpolates to an empty string. npm CLI then publishes with an empty bearer token instead of negotiating OIDC and the registry returns 404 / no permission. Thealways-authwarning above is from that same auto-generated.npmrc.Per npm's Trusted Publishers announcement:
Fix
Drop
registry-urlfromsetup-node. With no.npmrcwritten, npm uses its default registry (https://registry.npmjs.org/) and detects the GitHub Actions OIDC environment to perform Trusted Publishing.Test plan
component=wren-core-wasmand confirm publish succeeds via OIDC.🤖 Generated with Claude Code
Summary by CodeRabbit