Skip to content

Commit 440164d

Browse files
committed
ci: use bot credentials for the commit
1 parent bbd614f commit 440164d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/upgrade-template-deps.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,21 @@ jobs:
3232
- name: Run upgrade script
3333
run: node scripts/upgrade-template-deps.mts
3434

35+
- name: Get GitHub App user ID
36+
id: app-user
37+
run: echo "user-id=$(gh api '/users/${{ steps.app-token.outputs.app-slug }}[bot]' --jq .id)" >> "$GITHUB_OUTPUT"
38+
env:
39+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
40+
3541
- name: Create or update pull request
3642
run: |
3743
if [ -z "$(git status --porcelain)" ]; then
3844
echo "No changes to commit."
3945
exit 0
4046
fi
4147
42-
git config user.name "github-actions[bot]"
43-
git config user.email "github-actions[bot]@users.noreply.github.com"
48+
git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]"
49+
git config user.email "${{ steps.app-user.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
4450
4551
branch="upgrade-template-deps"
4652

0 commit comments

Comments
 (0)