Skip to content

Commit bf3b0c9

Browse files
ci: migrate GH_TOKEN_ADMIN to GitHub App token
Replace the long-lived PAT (GH_TOKEN_ADMIN) with a short-lived GitHub App installation token generated by actions/create-github-app-token@v3 in the publish job. Made-with: Cursor
1 parent bd058ef commit bf3b0c9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/build-test-release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ jobs:
167167
# Very important: semantic-release won't trigger a tagged
168168
# build if this is not set false
169169
persist-credentials: false
170+
- name: Generate GitHub App Token
171+
id: app-token
172+
uses: actions/create-github-app-token@v3
173+
with:
174+
client-id: ${{ secrets.GH_APP_CLIENT_ID }}
175+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
176+
owner: ${{ github.repository_owner }}
170177
- uses: actions/setup-python@v5
171178
with:
172179
python-version: ${{ env.PYTHON_VERSION }}
@@ -184,7 +191,7 @@ jobs:
184191
extra_plugins: |
185192
semantic-release-replace-plugin
186193
env:
187-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
194+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
188195
- if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
189196
run: |
190197
poetry build

0 commit comments

Comments
 (0)