Switch npm publishing to Trusted Publishing (OIDC)#328
Merged
TrevorBurnham merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
- publish.yml: add id-token: write permission, drop NPM_ACCESS_TOKEN, upgrade checkout/setup-node to v4, pin npm@latest for OIDC support. - bin/publish: run npm publish directly from modules/react-arborist instead of yarn workspace ... npm publish (yarn 4's publish command does not participate in GitHub OIDC token exchange). Use yarn build-lib so we only build the package being published. - modules/react-arborist/package.json: correct repository.url and bugs URLs to jameskerr/react-arborist. npm's trusted-publisher check requires these to match the configured publisher, and this matches where the repo actually lives. After merging, a Trusted Publisher must be configured on npmjs.com for react-arborist pointing at jameskerr/react-arborist's publish.yml. Subsequent releases get provenance attestations for free.
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.
Replaces the long-lived NPM_ACCESS_TOKEN secret with GitHub Actions OIDC. Any maintainer with write access to this repo can cut a release; CI authenticates to npm directly via a short-lived OIDC token. Publishes also get provenance attestations automatically.
Changes
One-time npm configuration (required before first OIDC publish)
On https://www.npmjs.com/package/react-arborist under Settings → Trusted Publishers, add a GitHub Actions publisher:
Then delete the stale `NPM_ACCESS_TOKEN` repo secret.
Test plan