chore: modernize GitHub Actions workflow for npm trusted publishers #244
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates the GitHub Actions workflow to comply with the 2025 npm authentication and token management changes, adopting GitHub's OIDC-based trusted publishers for enhanced security.
Changes Made
Action Version Updates
v2tov5in both main and release jobsv2tov6in both main and release jobsv2tov5.0.2Node Version Modernization
[18, 20]to[lts/-1, lts/*, latest]to automatically test against previous LTS, current LTS, and latest Node.js versions20tolts/*for automatic LTS version usageSemantic Release Configuration
17to25to use the latest semantic-release major versionSecurity Improvements
NPM_TOKEN: No longer required as npm releases now use GitHub's OIDC authenticationcontents: write- to publish GitHub releasesid-token: write- to enable OIDC for npm provenanceissues: write- to comment on released issuespull-requests: write- to comment on released pull requestsBenefits
lts/*andlatestmeans the workflow adapts to new Node.js versions without manual updatesTesting
The YAML syntax has been validated and all changes maintain the existing workflow structure without modifying unrelated logic or configurations.
Original prompt
Fixes #243
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Note
Updates
validateworkflow to latest action versions, LTS/Latest Node matrix, adds release permissions for OIDC, upgrades semantic-release, and removesNPM_TOKEN..github/workflows/validate.yml)actions/checkoutv2→v5actions/setup-nodev2→v6[18, 20]→[lts/-1, lts/*, latest]node-version: 20→lts/*permissions:contents: write,id-token: write,issues: write,pull-requests: writecycjimmy/semantic-release-actionv2→v5.0.2;semantic_version17→25NPM_TOKENenv (using OIDC)Written by Cursor Bugbot for commit 675e58c. This will update automatically on new commits. Configure here.