feat: auto-generate action workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: auto-generate | |
on: pull_request | |
jobs: | |
auto-generate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.22' | |
- name: make generate | |
run: make generate | |
- name: commit and push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if git diff-index --quiet HEAD; then | |
echo "no changes detected, nothing to commit" | |
exit 0 | |
fi | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "chore: auto-generate" | |
git push |