-
Notifications
You must be signed in to change notification settings - Fork 30
Migrate to NPM trusted publishing #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the NPM publish workflow to use NPM's trusted publishing feature, which replaces manual token-based authentication with OIDC (OpenID Connect) authentication. This enhances security by eliminating the need to manage long-lived NPM tokens.
Changes:
- Added
id-token: writepermission to enable OIDC authentication - Updated
actions/setup-nodefrom v3 to v4 for trusted publishing support - Removed the
npm whoamidebug command and theNODE_AUTH_TOKENsecret usage
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - run: npm whoami; npm --ignore-scripts publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||
| - run: npm --ignore-scripts publish |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using NPM trusted publishing with OIDC, it's recommended to add the --provenance flag to the publish command. This generates signed provenance attestations that provide verifiable information about how the package was built, enhancing supply chain security. Change this line to: npm --ignore-scripts publish --provenance
| - run: npm --ignore-scripts publish | |
| - run: npm --ignore-scripts publish --provenance |
|
|
||
| on: | ||
| release: | ||
| types: [created] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will work now, but we might want to add another trigger here so we can manually run it
Updates the publish workflow to use NPM's trusted publishing feature, which uses OIDC authentication instead of npm tokens.
Migration guide: https://docs.npmjs.com/trusted-publishers