-
Notifications
You must be signed in to change notification settings - Fork 2
chore: add OIDC authentication for npm in release workflow #53
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
|
| - name: Enable Corepack | ||
| run: corepack enable |
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.
dev: per our offline discussion with @causaly-mark this is not needed anymore
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" |
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.
| @@ -1 +1 @@ | |||
| 20.13.0 | |||
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.
dev: upgrade to what is soon to be the latest LTS
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 updates the GitHub Actions release workflow to use OpenID Connect (OIDC) authentication with npm instead of classic npm tokens, aligning with npm's security recommendations. The changes also modernize the Node.js version configuration.
- Replaces NPM_TOKEN secret-based authentication with OIDC authentication
- Updates Node.js version from 20.13.0 to 24
- Simplifies the Husky commit-msg hook
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .nvmrc | Updates Node.js version from 20.13.0 to 24 |
| .husky/commit-msg | Removes shebang and Husky setup lines, keeping only the commitlint command |
| .github/workflows/release.yml | Adds OIDC permissions, removes NPM_TOKEN environment variables, and configures npm registry URL |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| publish: npm run release | ||
| commit: 'chore: version packages' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} |
Copilot
AI
Oct 22, 2025
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 OIDC authentication requires the NODE_AUTH_TOKEN environment variable to be set for npm publishing. Add NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} to the env block, or if using provenance-based OIDC publishing without a token, ensure the changesets/action@v1 is configured to use OIDC authentication properly.
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| #!/usr/bin/env sh | ||
| . "$(dirname -- "$0")/_/husky.sh" | ||
|
|
||
| npx --no -- commitlint --edit ${1} |
Copilot
AI
Oct 22, 2025
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.
Removing the shebang line makes this script non-executable. The file needs #!/usr/bin/env sh at the top to be directly executable by Git hooks.
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.
Fuck AI ✊

Add OIDC authentication for npm, based on https://docs.npmjs.com/trusted-publishers#step-2-configure-your-cicd-workflow. This is an attempt to move away from npm classic tokens per https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/
The relevant changes have been made on the npm side (see below).