Switch publish-npm to npm Trusted Publishers (OIDC) and remove npm token auth#106
Merged
Conversation
Copilot
AI
changed the title
[WIP] Update publish-npm job to use trusted publishing
Switch Jun 30, 2026
publish-npm to npm Trusted Publishers (OIDC) and remove npm token auth
jonrohan
approved these changes
Jun 30, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the release publishing workflow to publish to npm via npm Trusted Publishers (OIDC) rather than a long-lived npm token, while keeping GitHub Packages publishing unchanged.
Changes:
- Removes
NODE_AUTH_TOKEN/secrets.npm_tokenusage and the token-dependentnpm whoamiprecheck from the npm publish job. - Ensures a sufficiently new npm CLI is installed before publishing with provenance by upgrading npm in the workflow.
- Leaves
publish-githubbehavior intact (still usesGITHUB_TOKENfor GitHub Packages).
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/publish.yml | Switches the npm publish job to OIDC/trusted publishing and updates the npm CLI install step accordingly. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
+42
to
+43
| # npm 11.5.1+ is required for trusted publishing (OIDC) with provenance | ||
| - run: npm install -g npm@latest |
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.
This updates the npm release workflow to use npm Trusted Publishers (OIDC) instead of a long-lived
npm_token, while leaving GitHub Packages publishing unchanged. Thepublish-npmjob now aligns with npm provenance + OIDC requirements for modern npm clients.publish-npm: OIDC-based npm publishNODE_AUTH_TOKEN/secrets.npm_tokenfrom the publish step.npm whoami(token-dependent precheck not compatible with tokenless trusted publishing).permissions.id-token: writeunchanged for OIDC token exchange.--provenanceand--access publicon publish.npm client compatibility for trusted publishing
npm install -g npmtonpm install -g npm@latestso the job uses an npm version that supports trusted publishing with provenance (11.5.1+ required).Scope protection
publish-github; it continues to authenticate withGITHUB_TOKENfor GitHub Packages.After merge, a maintainer still needs to register this workflow as an npm trusted publisher for
@github/combobox-nav(Settings → Trusted Publishers → GitHub Actions):githubcombobox-navpublish.yml