ci: publish to npm via Trusted Publishing (OIDC)#11
Merged
Conversation
Replace the long-lived NPM_TOKEN secret with npm Trusted Publishing. The publish job now requests `id-token: write` so npm can exchange a short-lived GitHub OIDC token for a publish credential, bumps Node to 24 (with an explicit npm upgrade for the >= 11.5.1 requirement), and swaps `yarn publish` for `npm publish` since Yarn Classic does not support OIDC. Provenance is attached automatically.
Replace Yarn Classic with npm across both workflows and the docs example: swap `yarn install --frozen-lockfile` for `npm ci`, `yarn build`/`yarn lint` for `npm run build`/`npm run lint`, `yarn version` for `npm version`, and the setup-node cache to "npm". Delete both yarn.lock files in favor of generated package-lock.json files.
| with: | ||
| node-version: "18.15" | ||
| cache: "yarn" | ||
| cache: "npm" |
enzomonjardin
approved these changes
Jun 2, 2026
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.
Switches npm publishing from a long-lived
NPM_TOKENsecret to npm Trusted Publishing (OIDC). Thepublishjob now requestsid-token: writeso npm can exchange a short-lived GitHub OIDC token for a publish credential, andyarn publishis replaced withnpm publishsince Yarn Classic does not support OIDC. Node is bumped to 24 with an explicitnpm install -g npm@latestto meet the npm >= 11.5.1 requirement, and provenance is now attached automatically.