Skip to content

Commit 8ce556b

Browse files
committed
security(release): replace release token with npm OIDC
1 parent d57c713 commit 8ce556b

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
@@ -12,17 +12,23 @@ on:
1212
- minor
1313
- major
1414

15+
permissions:
16+
id-token: write # Required for NPM OIDC
17+
1518
jobs:
1619
release:
1720
env:
1821
CI: true
1922
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
20-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2123
runs-on: ubuntu-latest
2224
steps:
2325
- uses: actions/checkout@v5
2426
with:
2527
fetch-depth: 0 # Need history for changelog generation
28+
- name: config git user
29+
run: |
30+
git config --global user.name ${{ secrets.ACTION_GITHUB_USERNAME }};
31+
git config --global user.email ${{ secrets.ACTION_GITHUB_EMAIL }};
2632
- uses: jdx/mise-action@v3
2733
- run: pnpm i --frozen-lockfile
2834
- name: types
@@ -39,12 +45,8 @@ jobs:
3945
- name: style
4046
if: ${{ always() }}
4147
run: pnpm format:check
42-
- name: npm registry auth
43-
run: pnpm config set "//registry.npmjs.org/:_authToken" ${{ env.NPM_TOKEN }}
44-
- name: config git user
45-
run: |
46-
git config --global user.name ${{ secrets.ACTION_GITHUB_USERNAME }};
47-
git config --global user.email ${{ secrets.ACTION_GITHUB_EMAIL }};
48+
- name: registry config
49+
run: pnpm config set registry="https://registry.npmjs.org"
4850
- name: perform release
4951
run: |
5052
pnpm release \

0 commit comments

Comments
 (0)