Skip to content

Commit 7bdc867

Browse files
committed
feat: migrate to npm trusted publishers (OIDC)
- Add id-token: write permission for OIDC authentication - Remove NPM_TOKEN secret dependency - Upgrade to Node.js 20 and latest npm (>= 11.5.1) - Add --provenance flag for package attestation - Aligns with TypeScript SDK trusted publisher configuration
1 parent 60327a2 commit 7bdc867

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,22 @@ jobs:
2626
npm-publish:
2727
needs: github-release
2828
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
contents: read
2932
steps:
3033
- name: Checkout
3134
uses: actions/checkout@v4
3235

3336
- name: Setup Node.js
3437
uses: actions/setup-node@v4
3538
with:
36-
node-version: '18'
39+
node-version: '20'
3740
registry-url: 'https://registry.npmjs.org'
3841

42+
- name: Upgrade npm to latest
43+
run: npm install -g npm@latest
44+
3945
- name: Install dependencies
4046
run: npm install
4147

@@ -53,6 +59,4 @@ jobs:
5359
fi
5460
5561
- name: Publish to NPM
56-
run: npm publish --access public
57-
env:
58-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)