Skip to content

Commit e9f549e

Browse files
authored
chore(ci): switch npm publish to token-less OIDC Trusted Publishing (#20)
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
1 parent 66cc0f2 commit e9f549e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,21 @@ jobs:
6969
runs-on: ubuntu-latest
7070
permissions:
7171
id-token: write
72+
contents: read
7273
steps:
7374
- uses: actions/checkout@v4
7475
- uses: actions/setup-node@v4
7576
with:
7677
node-version: 22
7778
registry-url: https://registry.npmjs.org
79+
- name: Ensure npm supports OIDC
80+
run: |
81+
echo "node $(node -v)"
82+
echo "npm $(npm -v)"
83+
npm install -g npm@latest
84+
echo "npm updated to $(npm -v)"
7885
- name: Publish
79-
env:
80-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
81-
run: cd nodejs && npm publish --provenance
86+
run: cd nodejs && npm publish
8287

8388
github-release:
8489
needs: [check, push-tags, release-python, release-nodejs]

0 commit comments

Comments
 (0)