yargs / yargs/cliui

Consider adopting npm trusted publishing

Open
#182 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
395
Forks
44
Avg merge
6m
Merged PRs (30d)
3

Description

Recent supply chain attacks on npm have highlighted the need for stronger package publishing security. The September 2025 Shai-Hulud worm compromised 500+ packages through stolen maintainer tokens, showing the risks of token-based publishing.

Trusted publishing helps by eliminating long-lived tokens that can be stolen or accidentally exposed; generating automatic provenance provides cryptographic proof of where/how packages are built; and is an industry standard adopted by PyPI, RubyGems, crates.io, NuGet, etc.

Here's the short version:

  1. Configure a trusted publisher on npmjs.com
  2. Add id-token: write permission to your workflow
  3. Remove NODE_AUTH_TOKEN from your workflow

npm is planning to deprecate legacy tokens and make trusted publishing the preferred method.

Would you consider adopting trusted publishing to help secure the npm ecosystem?

References:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the repository's GitHub Actions workflow and npm package-publishing configuration, then compare them with npm's trusted publishing and provenance guidance. Configure the trusted publisher, grant id-token: write, and remove NODE_AUTH_TOKEN; done means the package publishes successfully with provenance and no long-lived npm token.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
ci-cd, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.