Skip to content

Fix npm OIDC publish: restore registry-url and clear NODE_AUTH_TOKEN in publish steps#96

Merged
pcholakov merged 1 commit into
mainfrom
oidc-publish
May 6, 2026
Merged

Fix npm OIDC publish: restore registry-url and clear NODE_AUTH_TOKEN in publish steps#96
pcholakov merged 1 commit into
mainfrom
oidc-publish

Conversation

@pcholakov
Copy link
Copy Markdown
Collaborator

Summary

Followup to #95 which went too far.

  • Restores registry-url in setup-node (required: this is what creates the .npmrc that enables npm's OIDC token exchange; without it, npm has no auth config at all -> ENEEDAUTH)
  • setup-node with registry-url automatically exports NODE_AUTH_TOKEN=$GITHUB_TOKEN for subsequent steps; npm sees a non-empty token and uses it instead of OIDC, causing 404
  • Fix: explicitly set NODE_AUTH_TOKEN: "" in both publish steps so npm sees an empty token and falls through to OIDC trusted publishing exchange

No NPM_TOKEN secret needed once this lands.

Test plan

  • Merge and observe next snapshot publish succeeds via OIDC without NPM_TOKEN

@pcholakov pcholakov merged commit 8bff6d7 into main May 6, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant