generate.yml 1.5 KB

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