From b4354fc9ec14d8148749e3778c21816066a4f5b1 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 5 Mar 2026 10:21:37 +0100 Subject: [PATCH 1/3] ci: Add opencode to GitHub --- .github/workflows/opencode.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/opencode.yml diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml new file mode 100644 index 00000000..f455cba5 --- /dev/null +++ b/.github/workflows/opencode.yml @@ -0,0 +1,33 @@ +name: opencode + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +jobs: + opencode: + if: | + contains(github.event.comment.body, ' /oc') || + startsWith(github.event.comment.body, '/oc') || + contains(github.event.comment.body, ' /opencode') || + startsWith(github.event.comment.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: + persist-credentials: false + + - name: Run opencode + uses: anomalyco/opencode/github@latest + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + with: + model: opencode-go/glm-5 From 1bdda5a8862287d2ce328f626d70b73f97ec49cf Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 5 Mar 2026 11:30:03 +0100 Subject: [PATCH 2/3] address review comments --- .github/workflows/opencode.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index f455cba5..4e71e4f9 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -5,14 +5,18 @@ on: types: [created] pull_request_review_comment: types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] jobs: opencode: if: | - contains(github.event.comment.body, ' /oc') || - startsWith(github.event.comment.body, '/oc') || - contains(github.event.comment.body, ' /opencode') || - startsWith(github.event.comment.body, '/opencode') + (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 @@ -26,7 +30,7 @@ jobs: persist-credentials: false - name: Run opencode - uses: anomalyco/opencode/github@latest + uses: anomalyco/opencode/github@v1 env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} with: From ddabbe185d21558b22b4aba311d10e33c40a86ca Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Thu, 5 Mar 2026 11:34:30 +0100 Subject: [PATCH 3/3] Improve according to claudes comment. --- .github/workflows/opencode.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 4e71e4f9..e955236c 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -27,6 +27,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 with: + fetch-depth: 1 persist-credentials: false - name: Run opencode