Skip to content

Commit 0f2bebb

Browse files
committed
Switch to npm OIDC trusted publishing
- Add id-token: write permission for OIDC authentication - Upgrade Node.js 18 → 22 for npm compatibility - Install latest npm (≥11.5.1) for OIDC support - Use npm publish --provenance for attestations - Remove NPM_TOKEN dependency (no longer needed)
1 parent 2d9520f commit 0f2bebb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
permissions:
5555
contents: write
5656
packages: write
57+
id-token: write
5758
steps:
5859
- uses: actions/checkout@v4
5960
with:
@@ -63,9 +64,12 @@ jobs:
6364
- name: Setup Node.js
6465
uses: actions/setup-node@v4
6566
with:
66-
node-version: '18'
67+
node-version: '22'
6768
registry-url: 'https://registry.npmjs.org'
6869

70+
- name: Install latest npm for OIDC support
71+
run: npm install -g npm@latest
72+
6973
- name: Install dependencies
7074
run: npm ci
7175

@@ -110,6 +114,4 @@ jobs:
110114
generate_release_notes: true
111115

112116
- name: Publish to npm
113-
run: npm publish --access public
114-
env:
115-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
117+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)