fix(release): enable npm trusted publishing (OIDC)#236
Merged
Conversation
The release workflow failed to publish with an npm E404 because it never performed an OIDC token exchange: the job was missing the 'id-token: write' permission, so no trusted-publishing token was minted and the unauthenticated publish was rejected. - Add id-token: write (OIDC) and contents: write (push commit/tag) permissions - Upgrade npm to latest (trusted publishing requires npm >= 11.5.1) - Drop the obsolete NODE_AUTH_TOKEN env now that we use trusted publishing
robhogan
approved these changes
Jul 8, 2026
| with: | ||
| node-version: 'lts/*' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Ensure npm supports trusted publishing |
Collaborator
There was a problem hiding this comment.
This isn't needed - it's already Node 24 + npm > 11.5
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.
Summary
The Release workflow failed to publish the template with an npm
E404(see run 28942433881).The 404 was misleading — it's what npm returns for an unauthenticated publish. The root cause: now that we use trusted publishing, the workflow needs to perform an OIDC token exchange, but it never did. The job was missing the
id-token: writepermission, so GitHub never minted an OIDC token and the publish went out with no credentials.Changes
permissions: id-token: write(OIDC token exchange for trusted publishing) andcontents: write(so the bump commit & tag can still be pushed — once apermissionsblock is declared, unlisted scopes default tonone).NODE_AUTH_TOKENenv from the publish step.(
node-version: lts/*already bundles npm >= 11.5.1, which is required for trusted publishing, so no npm upgrade step is needed.)Follow-ups to verify (outside this repo)
react-native-community, repotemplate, workflowrelease.yaml, environmentnpm-publish.npm-publishdeployment branch rules must permit*-stablebranches.Note: the bump commit/tag from the failed run already landed (
1e63335), so a re-run will take the "No changes… Continue to retry" path straight to publishing.