Skip to content

Publish npm package via trusted publishing (NPM_TOKEN rejected) - #3

Merged
rvegajr merged 1 commit into
mainfrom
ci/npm-trusted-publishing
Sep 30, 2026
Merged

rvegajr merged 1 commit into
mainfrom
ci/npm-trusted-publishing

Conversation

@rvegajr

@rvegajr rvegajr commented Sep 30, 2026

Copy link
Copy Markdown
Member

Why

The v1.0.5 npm publish failed with E404 PUT @noctusoft/ezodata-express. npm is restricting tokens that bypass 2FA: account changes began in Aug 2026, and direct token publishing ends in Jan 2027. The NuGet side of 1.0.5 published fine.

What

  • The npm job gets id-token: write and publishes with npm trusted publishing (GitHub OIDC). No NPM_TOKEN is needed, and npm records provenance automatically.
  • It upgrades to npm CLI ≥ 11.5.1, which trusted publishing requires, and publishes pnpm's build with npm publish. There are no workspace: dependencies.
  • js/package.json gets a repository field. npm requires it to match this repo for provenance.

Before merging

Add the trusted publisher on npmjs.com under @noctusoft/ezodata-express → Settings → Trusted Publisher → GitHub Actions:

  • organization YOLOVibeCode
  • repository ez-odata-api
  • workflow ci.yml
  • environment left blank

Then

Tag js-v1.0.5 on the merge commit. That runs the npm-only release path, which publishes 1.0.5 without re-publishing NuGet.

npm is restricting tokens that bypass 2FA (account changes Aug 2026, direct
publishing Jan 2027); the NPM_TOKEN publish for v1.0.5 was rejected (E404).
Publish with GitHub OIDC instead: id-token permission on the npm job, npm CLI
>= 11.5.1, and a package.json repository field matching this repo (required
for provenance).
@rvegajr
rvegajr merged commit 9e72fe8 into main Sep 30, 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