Node.js and JavaScript

npm trusted publishing configs now expire after 48 hours if unused

Since October 2, 2026, npm trusted publishing configurations that are not used within 48 hours expire, and issue_comment workflows can no longer publish. Together with stage-only tokens and a January 2027 target to end direct publishing with 2FA-bypass tokens, teams that publish private storefront packages from CI need to change their pipelines.

In short: Since October 2, 2026, npm trusted publishing setups that are not used within 48 hours expire, and GitHub Actions issue_comment workflows can no longer publish. Stage-only tokens need a maintainer's 2FA approval to publish, and npm aims to end publishing with 2FA-bypass tokens in January 2027. Teams publishing packages from CI should update pipelines.

Intelligize Digital 4 min readAll notes

npm trusted publishing configs now expire after 48 hours if unused

Key points

  • Since October 2, 2026, unvalidated npm trusted publishing configurations expire 48 hours after creation.
  • npm now rejects trusted publishing tokens from GitHub Actions issue_comment events, as well as pull_request_target.
  • Stage-only granular tokens, added September 18, 2026, can stage a version but cannot publish it without a maintainer's 2FA approval.
  • npm is targeting January 2027 to remove direct publishing through 2FA-bypass granular access tokens.
On this page

What npm changed on October 2

GitHub has spent the second half of 2026 narrowing the ways a package can reach the npm registry. The newest step came on October 2, 2026: trusted publishing configurations that have not been used now expire 48 hours after creation and can no longer authorize a publish. A configuration becomes validated, and exempt from expiry, after its first successful publish. Changing the repository or project identity creates a new trust relationship with a fresh 48-hour window, while ordinary edits do not reset the clock. Expired configurations stay visible in the package settings, and other valid configurations on the same package keep working. GitHub gives the reason as limiting the risk of trusting a repository or project name that later changes ownership.

The same entry blocks trusted publishing tokens from GitHub Actions workflows triggered by issue_comment, in addition to the existing block on pull_request_target. A workflow that publishes when someone comments on an issue or pull request has to move to push, release or workflow_dispatch.

Stage-only tokens and staged publishing for new packages

On September 18 npm added a “Read and write (stage only)” permission for granular access tokens. The workflow runs npm stage publish, and a maintainer reviews the staged version and approves it with two-factor authentication. With a stage-only token, npm publish is rejected even when the token is set to bypass 2FA. The token keeps other write permissions, such as changing dist-tags and deprecating versions, so GitHub says to protect it like any other write token. It needs npm CLI 11.15.0 or later, Node.js 22.14.0 or later and 2FA on the account. The option is opt-in, and existing tokens keep their current rights until npm changes them.

A second entry on October 2 let staged publishing create a brand new package. That covers public scoped, public unscoped and private scoped packages. The first version lands in the staged queue, and nobody can install it until a maintainer promotes it. Before this, a team using staged publishing still needed a manual first publish.

The January 2027 target for 2FA-bypass tokens

These changes point at one date. A July 8 changelog entry set out a two-stage phase-out of granular tokens that bypass 2FA, and the July 31 entry confirmed the first stage. Those tokens can no longer create or delete tokens, change package access, maintainers or trusted publishing settings, or manage organization membership without an interactive 2FA challenge. The second stage, which GitHub describes as targeted for January 2027, removes their direct publish rights. They will still be able to read private packages and stage a publish for human approval. GitHub personal access tokens, GitHub App tokens and GITHUB_TOKEN in Actions are not part of this change.

The July 8 entry also made npm v12 the latest release, with new install defaults. Dependency lifecycle scripts no longer run unless allowed, and git and remote URL dependencies are not resolved unless allowed. That is older news, but it explains failed builds on teams that upgraded npm without reading the notes. GitHub’s fix is to run npm approve-scripts --allow-scripts-pending and commit the resulting allowlist in package.json.

Who this affects in an ecommerce team

Most merchants never publish to npm. Plenty of in-house teams and agencies do, often without calling it publishing: a private scoped package of shared storefront components, a client library for an ERP or PIM API, or a design system shared by a headless storefront and a marketing site. These packages tend to publish from CI with a long-lived token created years ago, set to bypass 2FA so the pipeline would not stall. That pattern loses direct publishing in January.

Teams that only consume packages also benefit. GitHub’s stated reason for the July restriction is that a leaked bypass token could be used to take over an account. The less a stolen token can do on its own, the less likely it is that a package in your storefront build gets a malicious version pushed without a human seeing it.

We would run the first staged publish on a throwaway prerelease version of a private package. If the approval step is misconfigured, it then blocks a test build instead of a real release the week before a sale.

What we would check before January

5 checks
  • List every npm token stored in CI secrets and hosting environment variables. Note whether each one bypasses 2FA and which packages it can write to.
  • For packages built in GitHub Actions, move to trusted publishing. Run a publish within 48 hours of creating the configuration, or plan to recreate it.
  • Check the triggers on publish workflows. Anything on issue_comment or pull_request_target needs to change.
  • Where trusted publishing is not possible, replace the token with a stage-only one, change npm publish to npm stage publish and name the people who approve releases.
  • Confirm the CI image has npm 11.15.0 and Node.js 22.14.0 or later, or staging will fail.
Certifications

Certifications and partner programmes

Intelligize Digital is a registered partner of these platforms and hosts.

  • BigCommerce BigDev CertifiedBigCommerce Certified
  • BigCommerce Certified PartnerBigCommerce Certified
  • Liquid Storefronts for Theme Developers (Shopify Certified)Liquid Storefronts for Theme DevelopersShopify Certified
  • Headless at Shopify for Developers (Shopify Certified)Headless at Shopify for DevelopersShopify Certified
  • Shopify Foundations (Shopify Certified)Shopify FoundationsShopify Certified

Is this job still done by hand in your store?

Tell us the job and the systems it touches. An engineer reads every request, and we aim to reply within one business day.

We save what you type here so we can follow up if you get interrupted.
One file, up to 10 MB: PDF, Word, Excel, CSV, text, PNG or JPG.

An engineer replies within one business day.

What happens next

  1. An engineer replies We aim to reply within one business day, by email.
  2. A free 30-minute audit On a call with an engineer.
  3. A fixed quote Usually within 3 business days of the audit. Nothing is billed before you agree it.

Book a free audit. One form, one reply from an engineer.

Tell us what you are building or fixing. An engineer reads every request and replies within one business day, with a fixed scope, price and dates once we have talked.

Direct
[email protected]
Response time
Within one business day
Cost of asking
Nothing. The first 30-minute audit is free.

An engineer reads every request.