Skip to content

Switch npm publish to trusted publishing (OIDC)#476

Merged
BSd3v merged 3 commits into
v35from
npm-trusted-publishing
Jul 15, 2026
Merged

Switch npm publish to trusted publishing (OIDC)#476
BSd3v merged 3 commits into
v35from
npm-trusted-publishing

Conversation

@ndrezn

@ndrezn ndrezn commented Jul 15, 2026

Copy link
Copy Markdown
Member

Why

Rather than rotate a credential that will expire again, this switches to trusted publishing via GitHub OIDC — the same approach pypi-publish.yml already uses for PyPI. No long-lived secret to expire or rotate.

Changes

  • Drop NODE_AUTH_TOKEN / secrets.NPM_TOKEN from the publish step (auth now via OIDC)
  • Drop the explicit --provenance flag (provenance is automatic with trusted publishing)
  • Add an npm upgrade step — trusted publishing OIDC requires npm >= 11.5.1, newer than the version bundled with Node 20

id-token: write and environment: name: npm were already present, so no permission changes are needed.

npmjs.com has been updated.

Replaces the long-lived NPM_TOKEN with GitHub OIDC-based trusted
publishing, matching how pypi-publish.yml already authenticates to PyPI.
This removes the expiring-credential failure mode: the npm publish had
been failing since v35.2.0 because the stored NPM_TOKEN was no longer
accepted by the registry (404 on PUT).

- Drop NODE_AUTH_TOKEN / secrets.NPM_TOKEN from the publish step
- Drop the explicit --provenance flag (provenance is automatic with
  trusted publishing)
- Add an npm upgrade step, since trusted publishing OIDC requires
  npm >= 11.5.1 (newer than the version bundled with Node 20)

Requires a one-time trusted publisher configuration on npmjs.com for
the dash-ag-grid package (repo plotly/dash-ag-grid, workflow
npm-publish.yml, environment npm).
@ndrezn
ndrezn force-pushed the npm-trusted-publishing branch from 4dbd129 to e568f3a Compare July 15, 2026 17:15
@BSd3v
BSd3v changed the base branch from main to v35 July 15, 2026 17:16

@BSd3v BSd3v left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

💃

@sonarqubecloud

Copy link
Copy Markdown

@BSd3v
BSd3v merged commit 566f2f9 into v35 Jul 15, 2026
3 checks passed
@BSd3v
BSd3v deleted the npm-trusted-publishing branch July 15, 2026 18:36
BSd3v added a commit to BSd3v/dash-ag-grid-real that referenced this pull request Jul 16, 2026
Switch npm publish to trusted publishing (OIDC)

(cherry picked from commit 566f2f9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants