chore(NODE-7566): migrate release workflow to npm Trusted Publishing#111
Open
tadjik1 wants to merge 1 commit into
Open
chore(NODE-7566): migrate release workflow to npm Trusted Publishing#111tadjik1 wants to merge 1 commit into
tadjik1 wants to merge 1 commit into
Conversation
Switch the publish job from NPM_TOKEN to OIDC. Since @mongodb-js/zstd has a single release workflow, release.yml is registered directly as the trusted publisher on npmjs.com — no separate npm-publish.yml needed. - Add id-token: write to the publish job (job-level, least-privilege). - Remove NODE_AUTH_TOKEN / NPM_TOKEN; npm publish --provenance uses OIDC. - Top-level permissions retain only contents: write and pull-requests: write.
There was a problem hiding this comment.
Pull request overview
Migrates the npm release flow from a long-lived NPM_TOKEN to npm Trusted Publishing (OIDC), narrowing GitHub token permissions to least-privilege at the job level.
Changes:
- Drop
id-token: writefrom top-level permissions; keep onlycontents: writeandpull-requests: write. - Grant
id-token: write(andcontents: read) only on thepublishjob. - Remove
NODE_AUTH_TOKEN/NPM_TOKENfrom thenpm publish --provenancestep so OIDC is used instead.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PavelSafronov
approved these changes
May 18, 2026
PavelSafronov
left a comment
There was a problem hiding this comment.
Changes look good. Let's confirm the npm package info has been updated, then we can merge this.
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.
Description
Summary of Changes
Migrate
@mongodb-js/zstdoffNPM_TOKENand onto npm Trusted Publishing (OIDC) per NODE-7566.id-token: writeto thepublishjob (job-level, least-privilege). Thessdlcjob already has its ownid-token: writefor AWS OIDC.NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }};npm publish --provenanceobtains the OIDC token automatically.contents: writeandpull-requests: write.Notes for Reviewers
Before merging: An npm Trusted Publishing entry must be configured on npmjs.com for the
@mongodb-js/zstdpackage, pointing atrelease.ymlin this repo. Once verified,NPM_TOKENcan be removed from the repo secrets and the package switched to "Require two-factor authentication and disallow tokens."Double check the following
type(NODE-xxxx)[!]: description