Skip to content

Commit adbf6fe

Browse files
icebob-aiclaude
andcommitted
Update publish workflow to use npm Trusted Publishers (OIDC)
No more NPM_TOKEN secret needed — GitHub Actions authenticates directly via OIDC. Triggered on GitHub release creation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 927fe47 commit adbf6fe

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Publish to NPM
22

33
on:
4-
workflow_dispatch:
5-
# release:
6-
# types: [published]
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
id-token: write
9+
contents: read
710

811
jobs:
912
publish:
@@ -16,7 +19,9 @@ jobs:
1619
uses: actions/setup-node@v4
1720
with:
1821
node-version: 22.x
19-
registry-url: https://registry.npmjs.org
22+
23+
- name: Update npm (OIDC support)
24+
run: npm install -g npm@latest
2025

2126
- name: Install dependencies
2227
run: npm ci
@@ -28,6 +33,4 @@ jobs:
2833
run: npm run build
2934

3035
- name: Publish
31-
run: npm publish --tag latest --access public
32-
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
run: npm publish --access public

0 commit comments

Comments
 (0)