Skip to content

fix(release): don't configure an npm token registry so OIDC trusted publishing can run#237

Merged
cipolleschi merged 1 commit into
0.87-stablefrom
fix/release-oidc-no-token-registry
Jul 8, 2026
Merged

fix(release): don't configure an npm token registry so OIDC trusted publishing can run#237
cipolleschi merged 1 commit into
0.87-stablefrom
fix/release-oidc-no-token-registry

Conversation

@cipolleschi

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #236. The release still failed with E404 (run 28944013848) even though id-token: write is now declared.

Looking at the run log, npm never attempted OIDC — it went straight to a token-based PUT and got 404. The cause: actions/setup-node with registry-url: 'https://registry.npmjs.org' injects a job-wide NODE_AUTH_TOKEN env var (it shows up on every step in the log) and writes an .npmrc containing //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}. npm's trusted publishing only activates when no auth token is configured, so npm used (empty) token auth and skipped OIDC.

Change

Remove registry-url from the setup-node step. The default registry is already https://registry.npmjs.org/, and publishConfig.access: public is set in package.json, so no token-based .npmrc is needed.

⚠️ Also needs a settings change (not fixable in this file)

In the failed run, the GITHUB_TOKEN Permissions group listed only:

Contents: write
Metadata: read

Id-token: write was requested but not granted, which means OIDC token minting is disabled at the org/enterprise level. Even with this PR, trusted publishing can't work until an admin allows the id-token permission for this repo's Actions. Please also confirm the npm trusted-publisher config (org react-native-community, repo template, workflow release.yaml, environment npm-publish).

setup-node's registry-url injects a job-wide NODE_AUTH_TOKEN and an .npmrc _authToken line. npm trusted publishing (OIDC) only kicks in when no token is configured, so npm was doing a token-based publish (E404) and never attempting OIDC. Drop registry-url; the default registry is already registry.npmjs.org.
@cipolleschi cipolleschi merged commit 6368a19 into 0.87-stable Jul 8, 2026
1 check passed
@cipolleschi cipolleschi deleted the fix/release-oidc-no-token-registry branch July 8, 2026 12: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