-
Notifications
You must be signed in to change notification settings - Fork 3
Support OIDC authentication for NPM publishing #52
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
NPM has deprecated classic tokens, so this adds support for OIDC authentication (Trusted Publishers) as an alternative to NPM_TOKEN. - Make NPM_TOKEN optional - only configure .npmrc when provided - For OIDC, npm handles auth automatically via GitHub's OIDC provider - Add documentation for OIDC setup in README - Bump version to 0.0.16 Fixes #50 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Points to Shopify/snapit@support-oidc-authentication to test OIDC support before merging the snapit PR. Related: Shopify/snapit#52 Co-Authored-By: Claude Opus 4.5 <[email protected]>
kbav
left a comment
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.
some comments/questions for now!
| Create a `.github/workflows/snapit.yml` file with the following contents. | ||
|
|
||
| **Deploy to NPM** | ||
| **Deploy to NPM (with OIDC authentication - recommended)** |
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.
(with OIDC authentication - recommended)
I don't know that it's "recommended" so much as required
| The `GITHUB_TOKEN` is needed for changesets to look up the current changeset when creating a snapshot. You can use the automatically created [`${{ secrets.GITHUB_TOKEN }}` to authenticate in the workflow job](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret). | ||
|
|
||
| **`NPM_TOKEN`** | ||
| **`NPM_TOKEN`** (optional) |
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.
We may want to outright remove the deprecated NPM_TOKEN approach
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.
surprised to not see added code but that could just as well speak to my ignorance for OIDC support 😅
Points to Shopify/snapit@support-oidc-authentication to test OIDC support before merging the snapit PR. Related: Shopify/snapit#52 Co-authored-by: Claude Opus 4.5 <[email protected]>
NPM has deprecated classic tokens, so this adds support for OIDC authentication (Trusted Publishers) as an alternative to NPM_TOKEN.
Fixes #50