From 87171467fa94041483d491952416987df4c43671 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 18 Dec 2025 19:03:11 -0600 Subject: [PATCH] ci: better err msg for generate workflow --- .github/workflows/generate.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 66a38c376..f9713a198 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -30,7 +30,6 @@ jobs: run: ./script/generate.ts - name: Commit and push - id: push run: | if [ -z "$(git status --porcelain)" ]; then echo "No changes to commit" @@ -40,16 +39,15 @@ jobs: git config --local user.name "GitHub Action" git add -A git commit -m "chore: generate" - git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify - - - name: Comment on failure - if: failure() - run: | - MESSAGE=$'Failed to push generated code. Please run locally and push:\n```\n./script/generate.ts\ngit add -A && git commit -m "chore: generate" && git push\n```' - if [ -n "${{ github.event.pull_request.number }}" ]; then - gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE" - else - gh api repos/${{ github.repository }}/commits/${{ github.sha }}/comments -f body="$MESSAGE" + if ! git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify; then + echo "" + echo "============================================" + echo "Failed to push generated code." + echo "Please run locally and push:" + echo "" + echo " ./script/generate.ts" + echo " git add -A && git commit -m \"chore: generate\" && git push" + echo "" + echo "============================================" + exit 1 fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}