diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml new file mode 100644 index 00000000..e955236c --- /dev/null +++ b/.github/workflows/opencode.yml @@ -0,0 +1,38 @@ +name: opencode + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + opencode: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/opencode')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/opencode')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '/opencode')) || + (github.event_name == 'issues' && contains(github.event.issue.body, '/opencode')) + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + pull-requests: read + issues: read + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + persist-credentials: false + + - name: Run opencode + uses: anomalyco/opencode/github@v1 + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + with: + model: opencode-go/glm-5