Skip to content

Conversation

@jmike
Copy link
Contributor

@jmike jmike commented Oct 22, 2025

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).

Screenshot 2025-10-22 at 11 35 11 AM

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

⚠️ No Changeset found

Latest commit: d4db34b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines -21 to -22
- name: Enable Corepack
run: corepack enable
Copy link
Contributor Author

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

Comment on lines -1 to -2
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev: the following screenshot explains why these lines have been removed

Image

@@ -1 +1 @@
20.13.0
Copy link
Contributor Author

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

Copy link

Copilot AI left a 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 }}
Copy link

Copilot AI Oct 22, 2025

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.

Suggested change
GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Copilot uses AI. Check for mistakes.
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
Copy link

Copilot AI Oct 22, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fuck AI ✊

@jmike jmike changed the title Chore OIDC npm authentication chore: add OIDC authentication for npm in release workflow Oct 22, 2025
@jmike jmike merged commit 3c4ce0c into main Oct 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants