Skip to content

Commit d205805

Browse files
authored
chore: bot auth for release (#182)
1 parent da19028 commit d205805

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/cd.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ jobs:
3737
runs-on: ubuntu-latest
3838

3939
steps:
40+
- name: Generate bot token
41+
uses: actions/create-github-app-token@v1
42+
id: app_token
43+
with:
44+
app-id: ${{ secrets.BOT_ID }}
45+
private-key: ${{ secrets.BOT_SK }}
46+
4047
- uses: actions/checkout@v4
4148
with:
4249
# Fetch entire repository history so we can determine version number from it
4350
fetch-depth: 0
51+
token: ${{ steps.app_token.outputs.token }}
4452

4553
- name: Set up Python
4654
uses: actions/setup-python@v5
@@ -59,7 +67,7 @@ jobs:
5967
id: get_branch
6068

6169
- name: Set Git user as GitHub actions
62-
run: git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
70+
run: git config --global user.email "179917785+engineering-ci[bot]@users.noreply.github.com" && git config --global user.name "engineering-ci[bot]"
6371

6472
- name: Create Continuous Deployment - Beta (non-prod)
6573
if: steps.get_branch.outputs.branch == 'main' && !inputs.production_release
@@ -72,7 +80,7 @@ jobs:
7280
publish
7381
gh release edit --prerelease "v$(poetry run semantic-release print-version --current)"
7482
env:
75-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
GH_TOKEN: ${{ steps.app_token.outputs.token }}
7684
REPOSITORY_USERNAME: __token__
7785
REPOSITORY_PASSWORD: ${{ secrets.PYPI_API_KEY }}
7886

@@ -87,6 +95,6 @@ jobs:
8795
--define=branch=main \
8896
publish
8997
env:
90-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
GH_TOKEN: ${{ steps.app_token.outputs.token }}
9199
REPOSITORY_USERNAME: __token__
92100
REPOSITORY_PASSWORD: ${{ secrets.PYPI_API_KEY }}

0 commit comments

Comments
 (0)