From ad29ed05147e21b28ea092d9d1a14a5a6cf5d33b Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Thu, 26 Sep 2024 14:32:40 -0700 Subject: [PATCH] feat: auto-generate action workflow --- .github/workflows/auto-generate.yaml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/auto-generate.yaml diff --git a/.github/workflows/auto-generate.yaml b/.github/workflows/auto-generate.yaml new file mode 100644 index 00000000000..15bd3cb8957 --- /dev/null +++ b/.github/workflows/auto-generate.yaml @@ -0,0 +1,32 @@ +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 \ No newline at end of file