feat: Enable NPM Trusted Publishing support#2434
Open
frol wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the GitHub Actions npm publishing job template (and corresponding test snapshots) to enable OIDC and to use a newer Node.js version during publish.
Changes:
- Add
permissions: id-token: writeto the npm publish job (OIDC support). - Bump
actions/setup-nodenode-versionfrom20.xto24.x. - Regenerate multiple CI YAML snapshots to match the updated template.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cargo-dist/templates/ci/github/partials/publish_npm.yml.j2 | Adds OIDC permissions and updates the Node.js version used for npm publishing. |
| cargo-dist/tests/snapshots/axolotlsay_simple_only.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_simple_and_order_no_github.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_simple_and_order2.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_simple_and_order1.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_build_setup_steps.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_basic_bins.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_attestations_host.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_attestations_filters.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_attestations_announce.snap | Updates snapshot output for OIDC permissions + Node version bump. |
| cargo-dist/tests/snapshots/axolotlsay_action_commit.snap | Updates snapshot output for OIDC permissions + Node version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #2403.
This is already tested in multiple CLIs, just to give an example: https://github.com/near/near-validator-cli-rs/blob/main/.github/workflows/release.yml#L290-L305 + CI run https://github.com/near/near-validator-cli-rs/actions/runs/27699830257/job/81937368485
The NPM_TOKEN / NODE_AUTH_TOKEN can still be left there for the initial publishing. If it is empty/not set in the CI secrets, it will be ignored and trusted publishing kicks in.
Node.js 22+ is required for the npm version that supports trusted publishing.