Skip to content

ci: publish to npm via OIDC trusted publishing#46

Merged
mergify[bot] merged 3 commits into
mainfrom
fix/npm-publishing
Jun 25, 2026
Merged

ci: publish to npm via OIDC trusted publishing#46
mergify[bot] merged 3 commits into
mainfrom
fix/npm-publishing

Conversation

@gavmck

@gavmck gavmck commented Jun 25, 2026

Copy link
Copy Markdown
Member

What

Replaces the NPM_TOKEN-based npm publish with npm OIDC trusted publishing, matching the etchteam/eslint setup.

Why

The release in #44 failed because the NPM_TOKEN secret was invalid/expired. Trusted publishing removes the long-lived token entirely — GitHub Actions mints a short-lived OIDC token at runtime that npm verifies against the registered trusted publisher. No secret to expire, rotate, or leak, and provenance attestations are added automatically.

Changes

.github/workflows/publish.yml

  • Drop NPM_TOKEN; add id-token: write (+ contents/issues/pull-requests: write) permissions for OIDC
  • Bump semantic_version 19.x → 25.0.1 to pull in @semantic-release/npm ≥ 13.1.0 (first version with OIDC support)
  • Add setup-node with node-version-file: .nvmrc + registry-url; pin action SHAs (matches eslint)

.nvmrc: 22 → 24 — OIDC requires npm ≥ 11.5.1, which ships with Node 24 (Node 22 ships npm 10.x).

Required setup (done)

The npm package's trusted publisher has been configured (npmjs.com → package Settings → Trusted Publisher → GitHub Actions: etchteam/stylelint, workflow publish.yml).

After merge, the next release on main publishes via OIDC. The now-unused NPM_TOKEN repo secret can be deleted.

Closes #44

Replaces the NPM_TOKEN-based publish (which broke in #44 when the token
became invalid) with npm OIDC trusted publishing, matching the etchteam/eslint
setup.

- Drop NPM_TOKEN; add id-token: write permission for OIDC
- Bump semantic-release 19.x -> 25.0.1 for @semantic-release/npm >= 13.1.0
- Add setup-node + registry-url; pin action SHAs
- Bump .nvmrc 22 -> 24 for npm >= 11.5.1 (required by OIDC)

Closes #44
Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml
@mergify
mergify Bot requested a review from ella-etch June 25, 2026 09:40
gavmck and others added 2 commits June 25, 2026 12:38
Co-authored-by: Josh Rose <1677846+JoshTheWanderer@users.noreply.github.com>
Co-authored-by: Josh Rose <1677846+JoshTheWanderer@users.noreply.github.com>
@gavmck
gavmck requested a review from JoshTheWanderer June 25, 2026 11:39
@mergify

mergify Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify
mergify Bot merged commit 10d282e into main Jun 25, 2026
9 checks passed
@mergify
mergify Bot deleted the fix/npm-publishing branch June 25, 2026 14:09
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

The automated release is failing 🚨

2 participants