Skip to content

Commit 0b8f07c

Browse files
committed
feat: switch npm publish to OIDC trusted publishing
- Add permissions (id-token: write) for OIDC provenance - Bump Node from 20 to 22 (npm CLI 11.5.1+ required for OIDC) - Add --provenance flag for supply chain attestation - Remove NPM_TOKEN secret (classic tokens revoked Dec 2025)
1 parent 304e511 commit 0b8f07c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ on:
77
jobs:
88
publish:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
1013
steps:
1114
- uses: actions/checkout@v4
1215

1316
- name: Setup Node.js
1417
uses: actions/setup-node@v4
1518
with:
16-
node-version: '20'
19+
node-version: '22'
1720
registry-url: https://registry.npmjs.org/
1821

1922
- name: Install dependencies
@@ -23,6 +26,4 @@ jobs:
2326
run: npm run build
2427

2528
- name: Publish to npm
26-
run: npm publish --access public
27-
env:
28-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
run: npm publish --access public --provenance

0 commit comments

Comments
 (0)