Skip to content

Update GitHub Actions workflows to use trusted publishers for npm#26

Merged
kentcdodds merged 2 commits intomainfrom
copilot/update-github-actions-workflows
Oct 22, 2025
Merged

Update GitHub Actions workflows to use trusted publishers for npm#26
kentcdodds merged 2 commits intomainfrom
copilot/update-github-actions-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 22, 2025

This PR updates the repository's GitHub Actions workflows to comply with the 2025 npm authentication and token management changes.

Changes

Action Version Updates

  • actions/checkout: Upgraded from v4 to v5 in both test and release jobs
  • actions/setup-node: Upgraded from v4 to v6 in both test and release jobs
  • cycjimmy/semantic-release-action: Upgraded from v4 to v5.0.2

Node.js Version Updates

  • Release job: Updated node-version from 20 to lts/* to automatically use the latest LTS version
  • Test job: Kept node-version: 20 as a stable version for consistent testing

Semantic Release Updates

  • semantic_version: Updated from 17 to 25 to use the current major version

Security Improvements

  • Removed NPM_TOKEN: The workflow no longer requires manual NPM token management. npm releases now use GitHub's OIDC authentication for provenance via the existing id-token: write permission and NPM_CONFIG_PROVENANCE: true environment variable.

Benefits

  • ✅ Enhanced security through OIDC-based authentication
  • ✅ No manual token rotation required
  • ✅ Automatic npm provenance for published packages
  • ✅ Future-proof with lts/* node version for releases
  • ✅ Up-to-date GitHub Actions for better performance and security

The existing permissions block already included all required permissions (contents: write, id-token: write, issues: write, pull-requests: write), so no changes were needed there.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update to use trusted publishers</issue_title>
<issue_description>Review and modernize this repository’s GitHub Actions workflows to comply with the 2025 npm authentication and token management changes.

Focus only on updating workflow steps and permissions, not environment configuration or unrelated logic.

Specifically:

  1. Upgrade all actions/checkout steps to the latest major version (currently v5).

  2. Upgrade all actions/setup-node steps to the latest major version (currently v6).

  3. Update node-version values to lts/* for the release job and if there's a matrix in place for other jobs, use relative versions from lts. For example: [lts/-1, lts/*, latest] so we don't have to keep these versions updated in the future. If it's a single node version, then lts/* alone works.

  4. Upgrade cycjimmy/semantic-release-action to the latest major version (currently v5.0.2).

  5. Update the semantic_version input to the current major (currently 25).

  6. Remove all references to NPM_TOKEN, as npm releases now use GitHub’s OIDC authentication for provenance.

  7. Add explicit permissions to the semantic-release job:

    permissions:
      contents: write # to be able to publish a GitHub release
      id-token: write # to enable use of OIDC for npm provenance
      issues: write # to be able to comment on released issues
      pull-requests: write # to be able to comment on released pull requests

Do not modify other permissions, secrets, job logic, or environment blocks unrelated to these security and release changes.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #25


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Note

Upgrade action versions and semantic-release, switch release Node to lts/*, and remove NPM_TOKEN to use OIDC/npm provenance.

  • CI/CD (GitHub Actions):
    • Upgrade actions/checkout from v4 to v5 in test and release jobs.
    • Upgrade actions/setup-node from v4 to v6; keep test on node-version: 20, set release to node-version: lts/*.
    • Upgrade cycjimmy/semantic-release-action from v4 to v5.0.2 and bump semantic_version from 17 to 25.
    • Remove NPM_TOKEN from env; continue using NPM_CONFIG_PROVENANCE: true with existing id-token: write permissions.

Written by Cursor Bugbot for commit 1b5263e. This will update automatically on new commits. Configure here.

Co-authored-by: kentcdodds <1500684+kentcdodds@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions workflows for trusted publishers Update GitHub Actions workflows to use trusted publishers for npm Oct 22, 2025
Copilot AI requested a review from kentcdodds October 22, 2025 23:48
@kentcdodds kentcdodds marked this pull request as ready for review October 22, 2025 23:51
@kentcdodds kentcdodds merged commit d75471a into main Oct 22, 2025
6 of 7 checks passed
@kentcdodds kentcdodds deleted the copilot/update-github-actions-workflows branch October 22, 2025 23:53
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.3.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to use trusted publishers

2 participants