diff --git a/.github/workflows/claude-translator.yml b/.github/workflows/claude-translator.yml index fb1fb723b..d5f7ea40d 100644 --- a/.github/workflows/claude-translator.yml +++ b/.github/workflows/claude-translator.yml @@ -5,15 +5,15 @@ concurrency: on: issues: - types: [opened, edited] + types: [opened] issue_comment: types: [created, edited] jobs: translate: if: | - (github.event_name == 'issues' && github.event.issue.author_association == 'COLLABORATOR' && !contains(github.event.issue.body, '**English Translation:**')) || - (github.event_name == 'issue_comment' && github.event.comment.author_association == 'COLLABORATOR' && !contains(github.event.comment.body, '**English Translation:**')) + (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.')) runs-on: ubuntu-latest permissions: contents: read @@ -32,7 +32,7 @@ jobs: id: claude with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} - claude_args: '--allowed-tools Bash(gh issue:*),Bash(gh api:repos/*/issues:*)' + claude_args: '--allowed-tools mcp__github_comment__update_claude_comment,Bash(gh issue:*),Bash(gh api:repos/*/issues:*)' prompt: | 你是一个多语言翻译助手。请完成以下任务: @@ -43,13 +43,16 @@ jobs: 3. 格式要求: - 标题:英文翻译(如果非英文) - 内容格式: - **English Translation:** + > [!NOTE] + > This issue/comment was translated by Claude. + [英文翻译内容] --- - - **Original Content:** +
+ **Original Content:** [原始内容] +
4. 使用gh工具更新: - 根据环境信息中的Event类型选择正确的命令: