Skip to content

Fix npm publish: remove registry-url to avoid conflict with OIDC trusted publishing#29

Merged
andeplane merged 2 commits intomasterfrom
fix/npm-publish-token
Mar 30, 2026
Merged

Fix npm publish: remove registry-url to avoid conflict with OIDC trusted publishing#29
andeplane merged 2 commits intomasterfrom
fix/npm-publish-token

Conversation

@andeplane
Copy link
Copy Markdown
Collaborator

@andeplane andeplane commented Mar 30, 2026

Problem

npm publish --provenance was failing with 404 Not Found. The trusted publisher is already configured on the npm account, but actions/setup-node with registry-url writes an .npmrc that expects a NODE_AUTH_TOKEN. This conflicts with OIDC auth — npm ends up confused about which auth method to use.

Fix

  • Remove registry-url from the setup-node step (not needed for OIDC publishing)
  • Restore id-token: write permission and --provenance flag
  • No NODE_AUTH_TOKEN needed

Test plan

  • Merge and bump the version in package.json → workflow should publish successfully via OIDC

🤖 Generated with Claude Code

OIDC trusted publishing requires npm account configuration that isn't
set up, causing a 404 on publish. Switch to explicit NPM_TOKEN secret
and drop --provenance.
When setup-node sets registry-url, it writes an .npmrc expecting
NODE_AUTH_TOKEN. This conflicts with OIDC trusted publishing.
Removing registry-url lets npm --provenance use OIDC auth cleanly.
@andeplane andeplane changed the title Fix npm publish: use NPM_TOKEN instead of OIDC provenance Fix npm publish: remove registry-url to avoid conflict with OIDC trusted publishing Mar 30, 2026
@andeplane andeplane merged commit 12ea1f4 into master Mar 30, 2026
1 check passed
@andeplane andeplane deleted the fix/npm-publish-token branch March 30, 2026 10:15
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