generate.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: generate
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. jobs:
  7. generate:
  8. runs-on: blacksmith-4vcpu-ubuntu-2404
  9. permissions:
  10. contents: write
  11. pull-requests: write
  12. steps:
  13. - name: Checkout repository
  14. uses: actions/checkout@v4
  15. - name: Setup Bun
  16. uses: ./.github/actions/setup-bun
  17. - name: Setup git committer
  18. id: committer
  19. uses: ./.github/actions/setup-git-committer
  20. with:
  21. opencode-app-id: ${{ vars.OPENCODE_APP_ID }}
  22. opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }}
  23. - name: Generate
  24. run: ./script/generate.ts
  25. - name: Commit and push
  26. run: |
  27. if [ -z "$(git status --porcelain)" ]; then
  28. echo "No changes to commit"
  29. exit 0
  30. fi
  31. git add -A
  32. git commit -m "chore: generate" --allow-empty
  33. git push origin HEAD:${{ github.ref_name }} --no-verify
  34. # if ! git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify; then
  35. # echo ""
  36. # echo "============================================"
  37. # echo "Failed to push generated code."
  38. # echo "Please run locally and push:"
  39. # echo ""
  40. # echo " ./script/generate.ts"
  41. # echo " git add -A && git commit -m \"chore: generate\" && git push"
  42. # echo ""
  43. # echo "============================================"
  44. # exit 1
  45. # fi