Skip to content

Commit 5e1c58b

Browse files
committed
fix: use GitHub App installation token for release workflow
1 parent d3f2e30 commit 5e1c58b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/release-and-publish.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ jobs:
5252
contents: write
5353

5454
steps:
55+
- name: Create GitHub App token
56+
id: app-token
57+
uses: actions/create-github-app-token@v3
58+
with:
59+
app-id: ${{ vars.ATTACK_AUTOBOT_APP_ID }}
60+
private-key: ${{ secrets.ATTACK_AUTOBOT_PRIVATE_KEY }}
61+
5562
# Note: We checkout the repository at the branch that triggered the workflow.
5663
# Python Semantic Release will automatically convert shallow clones to full clones
5764
# if needed to ensure proper history evaluation. However, we forcefully reset the
@@ -63,6 +70,8 @@ jobs:
6370
with:
6471
fetch-depth: 0
6572
ref: ${{ github.ref_name }}
73+
token: ${{ steps.app-token.outputs.token }}
74+
persist-credentials: false
6675

6776
- name: Setup | Force release branch to be at workflow sha
6877
run: |
@@ -83,7 +92,7 @@ jobs:
8392
id: release
8493
uses: python-semantic-release/python-semantic-release@v10.5.3
8594
with:
86-
github_token: ${{ secrets.ATTACK_AUTOBOT_RELEASE_TOKEN }}
95+
github_token: ${{ steps.app-token.outputs.token }}
8796
# NOTE: git_committer_name and git_committer_email are optional
8897
# We omit them because, if set, they must be associated with the provided token
8998
# and we don't really care to have a specific committer for automated releases.
@@ -92,7 +101,7 @@ jobs:
92101
uses: python-semantic-release/publish-action@v10.5.3
93102
if: steps.release.outputs.released == 'true'
94103
with:
95-
github_token: ${{ secrets.ATTACK_AUTOBOT_RELEASE_TOKEN }}
104+
github_token: ${{ steps.app-token.outputs.token }}
96105
tag: ${{ steps.release.outputs.tag }}
97106

98107
- name: Upload distribution artifacts

0 commit comments

Comments
 (0)