From 8b7776b5457d8bcd4b92ffc298645bf1ac413720 Mon Sep 17 00:00:00 2001 From: Phantom <59059173+EurFelux@users.noreply.github.com> Date: Sun, 7 Sep 2025 13:36:01 +0800 Subject: [PATCH] CI: launch claude translate for all comments (#9983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci(claude-translator): 临时禁用issues触发并更新条件 暂时禁用issues触发以解决上游bug 更新issue_comment的触发条件,简化claude_args参数 修改翻译结果的原始内容标题格式 * ci: 更新Claude翻译器工作流的名称和并发组配置 * fix(workflow): 修正Claude翻译工作流中的拼写错误 * ci(workflow): 更新claude-translator触发条件 添加对评论发送者类型的检查,避免机器人触发工作流 --- .github/workflows/claude-translator.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/claude-translator.yml b/.github/workflows/claude-translator.yml index d5f7ea40d8..0aeb635fc3 100644 --- a/.github/workflows/claude-translator.yml +++ b/.github/workflows/claude-translator.yml @@ -1,19 +1,24 @@ -name: English Translator +name: Claude Translator concurrency: - group: translator-${{ github.event.issue.number }} + group: translator-${{ github.event.comment.id || github.event.issue.number }} cancel-in-progress: false on: - issues: - types: [opened] + # temporally disable this because upstream bug. + # issues: + # types: [opened] issue_comment: types: [created, edited] jobs: translate: + # disable issues for now because upstream bug + # (github.event_name == 'issues' && github.event.issue.author_association == 'COLLABORATOR' && !contains(github.event.issue.body, 'This issue was translated by Claude.')) || + if: | - (github.event_name == 'issues' && github.event.issue.author_association == 'COLLABORATOR' && !contains(github.event.issue.body, 'This issue/comment was translated by Claude.')) || - (github.event_name == 'issue_comment' && github.event.comment.author_association == 'COLLABORATOR' && !contains(github.event.issue.body, 'This issue/comment was translated by Claude.')) + (github.event_name == 'issue_comment' && github.event.sender.type != 'Bot') && + ((github.event_name == 'issue_comment' && github.event.action == 'created' && !contains(github.event.comment.body, 'This issue was translated by Claude')) || + (github.event_name == 'issue_comment' && github.event.action == 'edited')) runs-on: ubuntu-latest permissions: contents: read @@ -32,7 +37,7 @@ jobs: id: claude with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - claude_args: '--allowed-tools mcp__github_comment__update_claude_comment,Bash(gh issue:*),Bash(gh api:repos/*/issues:*)' + claude_args: 'Bash(gh issue:*),Bash(gh api:repos/*/issues:*)' prompt: | 你是一个多语言翻译助手。请完成以下任务: @@ -50,7 +55,7 @@ jobs: ---
- **Original Content:** + Original Content [原始内容]