Skip to content

fix(ci): set registry-url so npm OIDC Trusted Publishing engages - #42

Merged
muralx merged 1 commit into
mainfrom
fix/publish-oidc-registry-url
Jul 27, 2026
Merged

fix(ci): set registry-url so npm OIDC Trusted Publishing engages#42
muralx merged 1 commit into
mainfrom
fix/publish-oidc-registry-url

Conversation

@muralx

@muralx muralx commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

publish-npm.yml authenticates to npm purely via OIDC Trusted Publishing (no NPM_TOKEN). Its Set up Node step omitted registry-url, so the npm CLI never wrote the //registry.npmjs.org/ auth scaffolding it keys off to perform the OIDC token exchange. npm fell straight through to demanding a classic credential, and the publish died with ENEEDAUTH before publishing any package.

This is why the pure-OIDC path never worked: both v0.2.0 and v0.3.0 failed identically (ENEEDAUTH, first npm publish step, no OIDC attempt logged).

Fix

Add registry-url: 'https://registry.npmjs.org' to actions/setup-node, matching npm's canonical Trusted Publishing example. Under OIDC no NODE_AUTH_TOKEN is exported, so the templated ${NODE_AUTH_TOKEN} resolves empty; npm's OIDC exchange overrides it (this is exactly the token-less scenario npm's own example documents).

The misleading comment that justified removing registry-url is rewritten to explain why it's required.

Release note

v0.3.0 was re-tagged onto a commit carrying this same fix and is publishing from there; this PR lands the fix on main so the next release (0.4.0) doesn't regress.

The publish-npm.yml Set up Node step omitted registry-url, so the npm CLI
never wrote the //registry.npmjs.org/ auth scaffolding it keys off to
perform the OIDC token exchange. npm fell through to demanding a classic
credential and both the v0.2.0 and v0.3.0 tags failed with ENEEDAUTH
before publishing any package.

Add registry-url: https://registry.npmjs.org to actions/setup-node,
matching npm's canonical Trusted Publishing example. Under OIDC no
NODE_AUTH_TOKEN is exported; the empty templated token is overridden by
the OIDC exchange.
@muralx
muralx requested a review from a team as a code owner July 27, 2026 11:27
@muralx
muralx merged commit 13bb80f into main Jul 27, 2026
7 checks passed
@muralx
muralx deleted the fix/publish-oidc-registry-url branch July 27, 2026 12:46
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.

2 participants