Skip to content

ci: enable OIDC trusted publishing (strip setup-node empty _authToken) - #7

Merged
vigubikReply merged 1 commit into
mainfrom
dev/fix-public-oidc-authtoken
Jul 23, 2026
Merged

ci: enable OIDC trusted publishing (strip setup-node empty _authToken)#7
vigubikReply merged 1 commit into
mainfrom
dev/fix-public-oidc-authtoken

Conversation

@vigubikReply

Copy link
Copy Markdown
Contributor

Root cause (confirmed via actions/setup-node#1551 + npm docs): setup-node with registry-url writes an empty //registry.npmjs.org/:_authToken= line when NODE_AUTH_TOKEN is unset. npm then treats auth as configured and never initiates the OIDC token exchange, so trusted publishing fails:

  • with the empty token present → E404 on the PUT (run 1),
  • with registry-url removed (no registry for OIDC) → ENEEDAUTH (run 2).

Fix: keep registry-url (required for OIDC) and delete the _authToken line from the .npmrc before publishing, so npm falls through to the OIDC exchange (ACTIONS_ID_TOKEN_REQUEST_*/-/npm/v1/oidc/token/exchange).

Also confirmed satisfied: npm 12.0.1 (≥11.5.1), node 22 (≥22.14), id-token: write, package.json repository.url matches the repo, explicit --provenance.

Nothing was ever published, so v0.3.0 is still free.

Ref: REPLY-51236

Restore registry-url (required for OIDC) and delete the empty _authToken

line setup-node writes; it was shadowing the OIDC exchange (ENEEDAUTH/404).

Root cause: actions/setup-node#1551.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vigubikReply
vigubikReply merged commit 34bf13a into main Jul 23, 2026
6 checks passed
@vigubikReply
vigubikReply deleted the dev/fix-public-oidc-authtoken branch July 23, 2026 20:56
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