-
Notifications
You must be signed in to change notification settings - Fork 165
npm oidc #1201
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
npm oidc #1201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,3 @@ | ||||||||
| # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||||||||
| # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||||||||
|
|
||||||||
| name: Publish Node.js Package | ||||||||
|
|
||||||||
| on: | ||||||||
|
|
@@ -9,43 +6,44 @@ on: | |||||||
| env: | ||||||||
| HUSKY: 0 | ||||||||
|
|
||||||||
| permissions: | ||||||||
| id-token: write # Required for OIDC | ||||||||
| contents: read | ||||||||
|
|
||||||||
| jobs: | ||||||||
| build: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
| runs-on: ubuntu-24.04 | ||||||||
|
|
||||||||
| - uses: actions/setup-node@v3 | ||||||||
| with: | ||||||||
| node-version: '20.x' | ||||||||
| permissions: | ||||||||
| id-token: write # Required for OIDC trusted publishing | ||||||||
| contents: write | ||||||||
|
|
||||||||
| publish-gpr: | ||||||||
| needs: build | ||||||||
| runs-on: ubuntu-latest | ||||||||
| publish: | ||||||||
|
||||||||
| publish: | |
| publish: |
Copilot
AI
Jan 9, 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.
The publish job permissions include 'packages: write' which is for GitHub Packages, but this workflow is publishing to npm registry. For OIDC trusted publishing to npm, you need 'id-token: write' permission instead. The 'packages: write' permission should be removed as it's not relevant for npm publishing.
| packages: write | |
| id-token: write # Required for OIDC trusted publishing to npm |
Copilot
AI
Jan 9, 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.
The publish job is missing the checkout step (actions/checkout). This step is required to check out the repository code before setting the package version, installing dependencies, building, and publishing. Without it, the workflow will fail as there will be no code to work with.
| - uses: actions/checkout@v4 |
Copilot
AI
Jan 9, 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.
Setting NODE_AUTH_TOKEN to an empty string will prevent npm authentication. For OIDC trusted publishing to work, you should either omit the NODE_AUTH_TOKEN environment variable entirely or configure it properly. When using OIDC with --provenance flag, npm will use the OIDC token automatically and NODE_AUTH_TOKEN should not be set.
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.
The build job is now empty with no steps defined. An empty job will fail to execute. Either remove this job entirely or add the necessary steps (checkout and setup-node at minimum).