Skip to content

Commit 03003b8

Browse files
committed
Set git user properly
1 parent bc8e23c commit 03003b8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/update-contributors.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ jobs:
3535
owner: ${{ github.repository_owner }}
3636
repositories: |
3737
pyroscope
38+
- name: Get GitHub App User ID
39+
id: get-user-id
40+
env:
41+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
42+
run: |
43+
APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]"
44+
echo "user-id=$(gh api "/users/${APP_BOT}" --jq .id)" >> "$GITHUB_OUTPUT"
3845
- uses: actions/setup-go@v5
3946
with:
4047
go-version: 1.23.11
@@ -43,8 +50,9 @@ jobs:
4350

4451
- name: Commit and push changes
4552
run: |
46-
git config --local user.name 'Pyroscope Bot'
47-
git config --local user.email '[email protected]'
53+
APP_BOT="${{ steps.generate_token.outputs.app-slug }}[bot]"
54+
git config --local user.name "${APP_BOT}"
55+
git config --local user.email "${{ steps.get-user-id.outputs.user-id }}+${APP_BOT}@users.noreply.github.com"
4856
if ! git diff --exit-code README.md; then
4957
git add README.md
5058
git commit -m 'docs: updates the list of contributors in README'

0 commit comments

Comments
 (0)