diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 5535f2a725..20bf26c8b4 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -12,12 +12,9 @@ on: jobs: claude-review: - # Optional: Filter by PR author - # if: | - # github.event.pull_request.user.login == 'external-contributor' || - # github.event.pull_request.user.login == 'new-developer' || - # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' - + # Only trigger code review for PRs from the main repository due to upstream OIDC issues + # https://github.com/anthropics/claude-code-action/issues/542 + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/claude-translator.yml b/.github/workflows/claude-translator.yml index bd0ac3e90d..e3939e72d7 100644 --- a/.github/workflows/claude-translator.yml +++ b/.github/workflows/claude-translator.yml @@ -4,18 +4,15 @@ concurrency: cancel-in-progress: false on: - # temporally disable this because upstream bug. - # issues: - # types: [opened] + 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_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')) @@ -33,9 +30,10 @@ jobs: fetch-depth: 1 - name: Run Claude for translation - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@main id: claude with: + github_token: ${{ secrets.GITHUB_TOKEN }} claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} claude_args: '--allowed-tools Bash(gh issue:*),Bash(gh api:repos/*/issues:*)' prompt: |