summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-12-18 19:03:11 -0600
committerAiden Cline <[email protected]>2025-12-18 19:03:16 -0600
commit87171467fa94041483d491952416987df4c43671 (patch)
tree7966044cf41595f1f38c31be648051fe24416070
parentb99afdad919215774024807ef8a3773925267e3c (diff)
downloadopencode-87171467fa94041483d491952416987df4c43671.tar.gz
opencode-87171467fa94041483d491952416987df4c43671.zip
ci: better err msg for generate workflow
-rw-r--r--.github/workflows/generate.yml24
1 files 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 }}