Skip to content

Commit 7d0c095

Browse files
chore: use GitHub App token for releases (#888)
1 parent 75cf2fe commit 7d0c095

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@ jobs:
99
permissions:
1010
id-token: write
1111
steps:
12+
- name: Generate GitHub App Token
13+
id: app-token
14+
uses: actions/create-github-app-token@v2
15+
with:
16+
app-id: ${{ secrets.OSS_CI_BOT_APP_ID }}
17+
private-key: ${{ secrets.OSS_CI_BOT_PRIVATE_KEY }}
18+
repositories: ${{ github.event.repository.name }}
19+
1220
- uses: actions/checkout@v4
1321
with:
1422
persist-credentials: false
1523
fetch-depth: 0
1624
ref: ${{ github.ref }}
25+
token: ${{ steps.app-token.outputs.token }}
1726

1827
- uses: pnpm/action-setup@v2
1928
with:
@@ -29,9 +38,9 @@ jobs:
2938
run: |
3039
git config --global user.name 'github-actions[bot]'
3140
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32-
git remote set-url origin https://github-actions[bot]:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
41+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
3342
env:
34-
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
43+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
3544
- name: Create Version
3645
run: pnpm lerna version --no-private --conventional-commits --yes
3746
- name: Set Current Version
@@ -44,7 +53,7 @@ jobs:
4453
body_path: "CHANGELOG.md"
4554
tag_name: ${{ env.CURRENT_VERSION }}
4655
env:
47-
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
56+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4857
- name: "NPM Identity"
4958
env:
5059
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)