Skip to content

Commit bd47ba1

Browse files
n24q02mclaude
andcommitted
fix(cd): replace GH_PAT with GitHub App installation token
Use actions/create-github-app-token to generate ephemeral tokens instead of static GH_PAT. Tokens auto-expire after 1 hour. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5d885d2 commit bd47ba1

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/cd.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,29 @@ jobs:
3737
with:
3838
egress-policy: audit
3939

40+
- name: Generate GitHub App Token
41+
id: app-token
42+
uses: actions/create-github-app-token@v2
43+
with:
44+
app-id: ${{ vars.CI_APP_ID }}
45+
private-key: ${{ secrets.CI_APP_KEY }}
46+
4047
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4148
with:
42-
token: ${{ secrets.GH_PAT }}
49+
token: ${{ steps.app-token.outputs.token }}
4350
fetch-depth: 0
4451

4552
- uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0 # v10
4653
id: release
4754
with:
48-
github_token: ${{ secrets.GH_PAT }}
55+
github_token: ${{ steps.app-token.outputs.token }}
4956
prerelease: ${{ inputs.release_type == 'beta' }}
5057
prerelease_token: beta
5158

5259
- uses: python-semantic-release/publish-action@310a9983a0ae878b29f3aac778d7c77c1db27378 # v10
5360
if: steps.release.outputs.released == 'true'
5461
with:
55-
github_token: ${{ secrets.GH_PAT }}
62+
github_token: ${{ steps.app-token.outputs.token }}
5663
tag: ${{ steps.release.outputs.tag }}
5764

5865
# ============================================================================

0 commit comments

Comments
 (0)