Skip to content

Commit 70534d0

Browse files
committed
Use GitHub App token when creating the release instead.
1 parent 0ffa4a3 commit 70534d0

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,22 @@ jobs:
4646
needs: build
4747

4848
permissions:
49-
contents: write
50-
id-token: write
5149
attestations: write
50+
id-token: write
5251

5352
steps:
53+
- name: Create GitHub app token
54+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 #v3.2.0
55+
id: app-token
56+
with:
57+
client-id: ${{vars.APP_CLIENT_ID}}
58+
private-key: ${{secrets.APP_PRIVATE_KEY}}
59+
permission-contents: write
60+
5461
- name: Checkout
5562
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 #v6.0.3
63+
with:
64+
token: ${{steps.app-token.outputs.token}}
5665

5766
- name: Download executables
5867
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c #v8.0.1
@@ -94,15 +103,15 @@ jobs:
94103
- name: Create and push tag
95104
shell: bash
96105
run: |
97-
git config user.name "github-actions[bot]"
98-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
106+
git config --global user.name '${{steps.app-token.outputs.app-slug}}[bot]'
107+
git config --global user.email '${{vars.APP_USER_ID}}+${{steps.app-token.outputs.app-slug}}[bot]@users.noreply.github.com'
99108
git tag $VERSION
100109
git push origin $VERSION
101110
102111
- name: Publish release
103112
shell: cmd
104113
env:
105-
GH_TOKEN: ${{github.token}}
114+
GH_TOKEN: ${{steps.app-token.outputs.token}}
106115
run: |
107116
gh release create "%VERSION%" ^
108117
--title "%VERSION%" ^

0 commit comments

Comments
 (0)