ci: switch npm publish to OIDC trusted publishing#1199
Merged
Conversation
- Upgrade npm to ^11.5.1 in the publish job (Node 22 bundles npm 10.x, which lacks OIDC trusted publishing support) - Drop NODE_AUTH_TOKEN / NPM_TOKEN secret in favor of OIDC - Enable provenance attestation via NPM_CONFIG_PROVENANCE The publish job already had id-token: write and registry-url configured.
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
Replaces the
NPM_TOKENsecret with npm's OIDC trusted publishing for thepublishjob.npm@^11.5.1before publish (Node 22's bundled npm 10.x doesn't support OIDC)NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}NPM_CONFIG_PROVENANCE: "true"so all 4 packages get provenance attestationsid-token: writeandregistry-urlwere already present, so no other changes neededThe GitHub environment has been renamed
Release→release(delete + recreate via API with identical required-reviewers) so the env name, workflow yaml, and npm trusted-publisher config all match exactly. npm matches the OIDCenvironmentclaim case-sensitively against the yaml value.Required manual setup before merge
On npmjs.com, configure a GitHub Actions trusted publisher for each package with:
modelcontextprotocolinspectormain.ymlreleasePackages to configure:
@modelcontextprotocol/inspector@modelcontextprotocol/inspector-client@modelcontextprotocol/inspector-server@modelcontextprotocol/inspector-cliTest plan
publishjob succeeds withoutNPM_TOKENNPM_TOKENsecret if one exists (env-level secret was already removed with the old environment)