Skip to content

feat: Enable NPM Trusted Publishing support#2434

Open
frol wants to merge 2 commits into
axodotdev:mainfrom
frol:feat/npm-trusted-publishing
Open

feat: Enable NPM Trusted Publishing support#2434
frol wants to merge 2 commits into
axodotdev:mainfrom
frol:feat/npm-trusted-publishing

Conversation

@frol

@frol frol commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings June 17, 2026 18:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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: write to the npm publish job (OIDC support).
  • Bump actions/setup-node node-version from 20.x to 24.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.

Comment thread cargo-dist/templates/ci/github/partials/publish_npm.yml.j2
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.

Support for npm trusted publishing

2 participants