Skip to content

Commit cd4b025

Browse files
authored
ci: fix npm OIDC — upgrade npm for trusted publishing support (#85)
npm OIDC trusted publishing requires npm >= 11.5.1 (Node 22's bundled npm is older). - Add `npm install -g npm@latest` before publish - Remove token clearing hack - Remove `--provenance` flag (automatic with OIDC) - No NPM_TOKEN needed Refs: [npm docs](https://docs.npmjs.com/trusted-publishers/), [guide](https://remarkablemark.org/blog/2025/12/19/npm-trusted-publishing/)
2 parents 10be15c + b1a09d5 commit cd4b025

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
registry-url: "https://registry.npmjs.org"
2222
- run: pnpm install --frozen-lockfile
2323

24+
# Ensure npm is new enough for OIDC trusted publishing (>= 11.5.1)
25+
- name: Update npm
26+
run: npm install -g npm@latest
27+
2428
- name: Check if version is already published
2529
id: check
2630
run: |
@@ -35,10 +39,7 @@ jobs:
3539
3640
- name: Build and publish
3741
if: steps.check.outputs.published == 'false'
38-
run: |
39-
# Clear the placeholder token so npm uses OIDC instead
40-
npm config set //registry.npmjs.org/:_authToken ""
41-
pnpm build && npm publish --access public --provenance
42+
run: pnpm build && npm publish --access public
4243

4344
- name: Ensure git tag exists
4445
if: steps.check.outputs.published == 'false'

0 commit comments

Comments
 (0)