Skip to content

ci(publish): switch to npm Trusted Publishing (OIDC) - #6

Merged
akshat009 merged 1 commit into
mainfrom
ci/fix-publish-trusted-publisher
Aug 19, 2026
Merged

ci(publish): switch to npm Trusted Publishing (OIDC)#6
akshat009 merged 1 commit into
mainfrom
ci/fix-publish-trusted-publisher

Conversation

@akshat009

Copy link
Copy Markdown
Owner

Granular access token publish failed with 403 despite Bypass-2FA + Read/write scoping. npm has removed Classic token creation for this account and is pushing Trusted Publishing (OIDC) instead -- no token/secret needed at all.

  • node-version bumped 20 -> 22 (npm CLI >=11.5.1 requirement for Trusted Publishing)
  • dropped NODE_AUTH_TOKEN/NPM_TOKEN entirely

Requires linking this repo+publish.yml under the package's Settings > Trusted publishing on npmjs.com (user has done this).

The granular access token approach failed: npm publish returned 403
("You may not perform that action with these credentials") even with
Bypass 2FA enabled and Read+write scoped to just this package. npm has
removed Classic token creation for this account, and their own direction
is clearly Trusted Publishing (OIDC) now -- no token/secret to store,
leak, or expire.

- node-version bumped 20 -> 22 (Trusted Publishing needs npm CLI >=11.5.1,
  which needs Node >=22.14)
- dropped the NODE_AUTH_TOKEN env var / NPM_TOKEN secret entirely; npm CLI
  auto-detects the OIDC context from id-token: write (already present)

Requires linking this repo + publish.yml under this package's Settings >
Trusted publishing on npmjs.com before it will work.
@akshat009
akshat009 merged commit 2f43a60 into main Aug 19, 2026
4 checks passed
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.

1 participant