Skip to content

Commit 6643f6b

Browse files
authored
Merge pull request #793 from strukturag/ci-generated-code-service-account
CI: Push generated code from service account.
2 parents c90d7ae + 49574e9 commit 6643f6b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/generated.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
- '*.proto'
2121
- 'go.*'
2222

23+
env:
24+
CODE_GENERATOR_NAME: struktur AG service user
25+
CODE_GENERATOR_EMAIL: [email protected]
26+
2327
permissions:
2428
contents: read
2529

@@ -34,6 +38,7 @@ jobs:
3438
steps:
3539
- uses: actions/checkout@v4
3640
with:
41+
token: ${{ secrets.CODE_GENERATOR_PAT }}
3742
ref: ${{ github.event.pull_request.head.ref }}
3843

3944
- uses: actions/setup-go@v5
@@ -60,9 +65,9 @@ jobs:
6065
if [ -z "$CHANGES" ]; then
6166
echo "No files have changed, no need to commit / push."
6267
else
63-
git config user.name "$(git log -n 1 --pretty=format:%an)"
64-
git config user.email "$(git log -n 1 --pretty=format:%ae)"
65-
git commit -m "Update generated files from ${{github.event.pull_request.head.sha}}" *_easyjson.go *.pb.go
68+
git config user.name "$CODE_GENERATOR_NAME"
69+
git config user.email "$CODE_GENERATOR_EMAIL"
70+
git commit --author="$(git log -n 1 --pretty=format:%an) <$(git log -n 1 --pretty=format:%ae)>" -m "Update generated files from ${{github.event.pull_request.head.sha}}" *_easyjson.go *.pb.go
6671
git push
6772
fi
6873
fi

0 commit comments

Comments
 (0)