fix(release): use setup-node@v6 with registry-url for OIDC trusted publishing#240
Merged
Merged
Conversation
…blishing The E404/ENEEDAUTH failures were because actions/setup-node@v4 predates npm trusted-publishing support: with registry-url it wrote a placeholder NODE_AUTH_TOKEN (npm used the bogus token -> E404), and without registry-url npm had no registry configured for the OIDC exchange (-> ENEEDAUTH). Match the official setup-node OIDC example: - bump actions/setup-node@v4.0.0 -> @v6 (adds trusted-publishing support) - keep registry-url: https://registry.npmjs.org - package-manager-cache: false (avoid leaking the OIDC token via a poisoned cache) - no NODE_AUTH_TOKEN Also removes the temporary OIDC diagnostic step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause (confirmed against the official setup-node docs)
The diagnostic in #238 proved
id-token: writeis granted (OIDC token is available) and npm is 11.16.0 — both fine. The real problem is theactions/setup-nodeversion: the workflow pins@v4.0.0, which predates npm trusted-publishing support.registry-url+ setup-node@v4 → v4 writes a placeholderNODE_AUTH_TOKEN(XXXXX-XXXXX-XXXXX-XXXXX) into.npmrcas_authToken. npm uses that bogus token and never attempts OIDC → E404.registry-url(fix(release): don't configure an npm token registry so OIDC trusted publishing can run #237) → no registry is configured for the OIDC exchange and v4 can't do OIDC → ENEEDAUTH.The official setup-node OIDC example uses
setup-node@v6+registry-url+ no token.Change
actions/setup-node@v4.0.0→@v6(adds trusted-publishing/OIDC support).registry-url: 'https://registry.npmjs.org'(reverts fix(release): don't configure an npm token registry so OIDC trusted publishing can run #237).package-manager-cache: false(docs-recommended: avoid leaking the short-lived OIDC token via a poisoned cache).NODE_AUTH_TOKEN.Supersedes #239 (the debug-log diagnostic is no longer needed).
Still required on npmjs.com
The trusted publisher must match the run identity exactly, or npm returns E404 even though the package exists: org
react-native-community, repotemplate, workflow filerelease.yaml, environmentnpm-publish.