Repository navigation
ci: switch npm publish to OIDC trusted publishing - #4274
Merged
Merged
Conversation
Remove the long-lived NPM_TOKEN_ELEVATED secret from the release job and rely on npm's OIDC trusted publishing via the existing id-token: write permission. Provenance is generated automatically under trusted publishing, so the explicit --provenance flag is no longer needed. Pin npm to latest in the release job since trusted publishing requires npm >= 11.5.1. Co-authored-by: v0agent <[email protected]>
Corepack is already enabled by the install action, so use it to activate a pinned npm version (11.5.1) for OIDC trusted publishing rather than an unpinned global `npm install -g npm@latest`. Co-authored-by: v0agent <[email protected]>
devjiwonchoi
approved these changes
Jun 20, 2026
OIDC trusted publishing requires npm >= 11.5.1. Install npm 11 globally in the release job before publishing. Co-authored-by: v0agent <[email protected]>
huozhi
force-pushed
the
oidc-trusted-publishing
branch
from
June 21, 2026 10:38
d871658 to
db1231d
Compare
promer94
approved these changes
Jun 22, 2026
shuding
approved these changes
Jun 22, 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.
The release pipeline currently authenticates
npm publishwith a long-livedNPM_TOKEN_ELEVATEDsecret. This moves it to npm's OIDC trusted publishing, which removes the need to store and rotate a publish token.What changed
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}env from both publish steps in thereleasejob — auth now flows through the existingid-token: writepermission via OIDC.--provenanceflag, since provenance is generated automatically under trusted publishing.latestin the release job, as trusted publishing requires npm >= 11.5.1 (Node 24's bundled npm may be older).Before merging
swrmust be configured as a trusted publisher for this repo/workflow on npmjs.com (Package settings → Trusted Publisher), pointing at.github/workflows/test-release.yml. Once that's set, theNPM_TOKEN_ELEVATEDsecret can be deleted.