Skip to content

Commit

Permalink
CI: Update author information when commiting generated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Jul 31, 2024
1 parent b2939d0 commit 49574e9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
- '*.proto'
- 'go.*'

env:
CODE_GENERATOR_NAME: struktur AG service user
CODE_GENERATOR_EMAIL: [email protected]

permissions:
contents: read

Expand Down Expand Up @@ -61,9 +65,9 @@ jobs:
if [ -z "$CHANGES" ]; then
echo "No files have changed, no need to commit / push."
else
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git commit -m "Update generated files from ${{github.event.pull_request.head.sha}}" *_easyjson.go *.pb.go
git config user.name "$CODE_GENERATOR_NAME"
git config user.email "$CODE_GENERATOR_EMAIL"
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
git push
fi
fi
Expand Down

0 comments on commit 49574e9

Please sign in to comment.