Skip to content

Commit 14bad1f

Browse files
committed
ci: switch npm publish to OIDC trusted publishing
1 parent 10f4960 commit 14bad1f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ on:
88
jobs:
99
release:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1316
with:
1417
fetch-depth: 0
1518

1619
- name: Install pnpm
17-
uses: pnpm/action-setup@v2
20+
uses: pnpm/action-setup@v4
1821

19-
# after pnpm
2022
- name: Use Node.js LTS
21-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2224
with:
2325
node-version: lts/*
2426
registry-url: https://registry.npmjs.org/
@@ -28,11 +30,11 @@ jobs:
2830
run: pnpm install
2931

3032
- run: npm run build --if-present
31-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
33+
3234
- run: pnpm publish --access public --no-git-checks
3335
env:
34-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
36+
NPM_CONFIG_PROVENANCE: true
3537

36-
- run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
38+
- run: npx changelogithub
3739
env:
3840
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)