Skip to content

Commit a2fd492

Browse files
committed
ci(release.yml): use release bot to publish to npm
1 parent 33366a0 commit a2fd492

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/release.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,25 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
2121
steps:
22+
- name: generate token
23+
id: generate_token
24+
uses: tibdex/github-app-token@v1
25+
with:
26+
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
27+
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
2228
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2329
with:
30+
persist-credentials: false
2431
fetch-depth: 0
32+
token: ${{ steps.generate_token.outputs.token }}
2533
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
2634
with:
2735
cache: npm
2836
node-version: lts/*
2937
- run: npm ci
3038
- run: npx semantic-release
3139
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
3341
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3442
GIT_AUTHOR_NAME: ${{ vars.RELEASE_BOT_GIT_AUTHOR_NAME }}
3543
GIT_AUTHOR_EMAIL: ${{ vars.RELEASE_BOT_GIT_AUTHOR_EMAIL }}

0 commit comments

Comments
 (0)