triage.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: triage
  2. on:
  3. issues:
  4. types: [opened]
  5. jobs:
  6. triage:
  7. runs-on: blacksmith-4vcpu-ubuntu-2404
  8. permissions:
  9. contents: read
  10. issues: write
  11. steps:
  12. - name: Checkout repository
  13. uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
  14. with:
  15. fetch-depth: 1
  16. - name: Check exempt issue author
  17. id: author
  18. run: |
  19. LOGIN="${{ github.event.issue.user.login }}"
  20. ASSOCIATION="${{ github.event.issue.author_association }}"
  21. if [ "$LOGIN" = "opencode-agent[bot]" ] ||
  22. [ "$ASSOCIATION" = "OWNER" ] ||
  23. [ "$ASSOCIATION" = "MEMBER" ] ||
  24. grep -qxiF "$LOGIN" .github/TEAM_MEMBERS; then
  25. echo "skip=true" >> "$GITHUB_OUTPUT"
  26. echo "Skipping issue automation for exempt author: $LOGIN ($ASSOCIATION)"
  27. else
  28. echo "skip=false" >> "$GITHUB_OUTPUT"
  29. fi
  30. - name: Setup Bun
  31. if: steps.author.outputs.skip != 'true'
  32. uses: ./.github/actions/setup-bun
  33. - name: Install opencode
  34. if: steps.author.outputs.skip != 'true'
  35. run: curl -fsSL https://opencode.ai/install | bash
  36. - name: Triage issue
  37. if: steps.author.outputs.skip != 'true'
  38. env:
  39. OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
  40. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  41. ISSUE_NUMBER: ${{ github.event.issue.number }}
  42. ISSUE_TITLE: ${{ github.event.issue.title }}
  43. ISSUE_BODY: ${{ github.event.issue.body }}
  44. run: |
  45. opencode run --agent triage "The following issue was just opened, triage it:
  46. Title: $ISSUE_TITLE
  47. $ISSUE_BODY"