From d9831e749d99f55ab05fe7a0869c83f70aece587 Mon Sep 17 00:00:00 2001 From: Faouzi Braza Date: Sat, 6 Sep 2025 19:34:49 +0200 Subject: [PATCH 1/5] build: modify workflow --- .github/workflows/opencode.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index eafaeca..83376eb 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -9,14 +9,13 @@ on: 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') || contains(github.event.issue.title, '@opencode'))) runs-on: ubuntu-latest permissions: contents: read @@ -30,4 +29,4 @@ jobs: env: ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} with: - model: zai/glm-4.5 \ No newline at end of file + model: zhipuai/glm-4.5 \ No newline at end of file From 639b3edc06e101cf7fb927795a0b504cb7f3b05d Mon Sep 17 00:00:00 2001 From: Faouzi Braza Date: Sat, 6 Sep 2025 19:37:32 +0200 Subject: [PATCH 2/5] build: update the pattern --- .github/workflows/opencode.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 83376eb..731ff34 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -12,10 +12,10 @@ on: 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') || contains(github.event.issue.title, '@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') || contains(github.event.issue.title, '/opencode'))) runs-on: ubuntu-latest permissions: contents: read From 9eefc3f3bb6e9e5af4ff7cabcb640ea7132f1530 Mon Sep 17 00:00:00 2001 From: Faouzi Braza Date: Sat, 6 Sep 2025 19:42:58 +0200 Subject: [PATCH 3/5] trial --- .github/workflows/opencode.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 731ff34..362e900 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -20,6 +20,8 @@ jobs: permissions: contents: read id-token: write + pull-requests: write + issues: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -29,4 +31,6 @@ jobs: env: ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} with: - model: zhipuai/glm-4.5 \ No newline at end of file + model: zhipuai/glm-4.5 + # share: true + # github_token: ${{ secrets.MY_GITHUB_TOKEN }} \ No newline at end of file From 2ec32bc0f93fb5e12ba6cd807c4997fa6ef1e0e1 Mon Sep 17 00:00:00 2001 From: Faouzi Braza Date: Sat, 6 Sep 2025 19:45:01 +0200 Subject: [PATCH 4/5] trial --- .github/workflows/opencode.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 362e900..4d9acf8 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -32,5 +32,5 @@ jobs: ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} with: model: zhipuai/glm-4.5 - # share: true - # github_token: ${{ secrets.MY_GITHUB_TOKEN }} \ No newline at end of file + share: true + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 4a63e0be64579054b60db514816d97ad29b2c711 Mon Sep 17 00:00:00 2001 From: Faouzi Braza Date: Sat, 6 Sep 2025 20:11:52 +0200 Subject: [PATCH 5/5] claude and glm for github actions --- .github/workflows/claude.yml | 59 ++++++++++++++++++++++++++++++++++ .github/workflows/opencode.yml | 36 --------------------- 2 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/claude.yml delete mode 100644 .github/workflows/opencode.yml diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 0000000..71245d3 --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,59 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + id-token: write + actions: read # Required for Claude to read CI results on PRs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + ANTHROPIC_BASE_URL: ${{ env.ANTHROPIC_BASE_URL }} + + # Optional: Customize the trigger phrase (default: @claude) + # trigger_phrase: "/claude" + + # Optional: Trigger when specific user is assigned to an issue + # assignee_trigger: "claude-bot" + + # Optional: Configure Claude's behavior with CLI arguments + # claude_args: | + # --model claude-opus-4-1-20250805 + # --max-turns 10 + # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" + # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." + + # Optional: Advanced settings configuration + # settings: | + # { + # "env": { + # "NODE_ENV": "test" + # } + # } \ No newline at end of file diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml deleted file mode 100644 index 4d9acf8..0000000 --- a/.github/workflows/opencode.yml +++ /dev/null @@ -1,36 +0,0 @@ -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') || contains(github.event.issue.title, '/opencode'))) - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - pull-requests: write - issues: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Run opencode - uses: sst/opencode/github@latest - env: - ZHIPU_API_KEY: ${{ secrets.ZHIPU_API_KEY }} - with: - model: zhipuai/glm-4.5 - share: true - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file