-
Notifications
You must be signed in to change notification settings - Fork 317
Migrate from NPM token to OIDC authentication (v4) #1250
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
Conversation
- Remove npm-token secret requirement from workflows - Add permissions block (contents: write, id-token: write) to release job - Remove NODE_AUTH_TOKEN environment variable from npm publish step - Set make_latest: false for GitHub releases to prevent v4 releases from being marked as latest - Update softprops/action-gh-release to v2.4.2 - Keep registry-url configuration for OIDC authentication
- Add v4 to pull_request and push branch triggers - Update cancel-in-progress to not cancel for both master and v4 branches
|
Claude finished @developerkunal's task —— View job PR Review Progress
Overall Assessment❌ This PR has a critical configuration issue that will cause npm publish to fail. The workflow removes |
Changes
This PR migrates the npm publishing workflow from static token-based authentication to OIDC (OpenID Connect) authentication for the v4 branch.
What's changing:
npm-tokensecret requirement from all workflowspermissions: id-token: writeandcontents: writeto the release job innpm-release.ymlNODE_AUTH_TOKENenvironment variable from the npm publish stepmake_latest: falsein release-create action to prevent v4 releases from being marked as "latest"softprops/action-gh-releaseto v2.4.2 (pinned to commit hash)Why this is important:
Files changed:
.github/workflows/npm-release.yml- Added permissions, removed npm-token secret.github/workflows/release.yml- Removed npm-token from secrets.github/actions/npm-publish/action.yml- Removed npm-token input and NODE_AUTH_TOKEN env var.github/actions/release-create/action.yml- Added make_latest: false, updated to v2.4.2References
Testing
The trusted publishing configuration on npmjs.com should already be set up from PR #1249. The same OIDC setup works for both branches since they use the same workflow file (
release.yml) and environment (release).Testing approach:
Checklist