Skip to content

Commit dd5025c

Browse files
CopilotbedaHovorka
andauthored
Fix Claude code review workflow authentication and bot handling (#11)
* Fix Claude code review workflow authentication Add github_token to claude-code-action to fix authentication error. The workflow was failing with "User does not have write access on this repository" because it was trying to use OIDC token exchange without proper GitHub App permissions. Using the standard GITHUB_TOKEN secret resolves this. * Skip Claude code review workflow for bot-created PRs Add conditional check to prevent workflow from running on PRs created by Copilot or other bots. The workflow was failing with "Copilot is not a user" error because the claude-code-action tries to check permissions for the PR author, and bot users like "Copilot" are not recognized as valid GitHub users by the collaborators API. The workflow will now only run for PRs created by human users. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
1 parent 4a1e8ba commit dd5025c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ on:
1212

1313
jobs:
1414
claude-review:
15-
# Optional: Filter by PR author
16-
# if: |
17-
# github.event.pull_request.user.login == 'external-contributor' ||
18-
# github.event.pull_request.user.login == 'new-developer' ||
19-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
15+
# Skip workflow for bot PRs (Copilot, Dependabot, etc.)
16+
if: |
17+
github.event.pull_request.user.login != 'Copilot' &&
18+
github.event.pull_request.user.type != 'Bot'
2019
2120
runs-on: ubuntu-latest
2221
permissions:
@@ -36,6 +35,7 @@ jobs:
3635
uses: anthropics/claude-code-action@v1
3736
with:
3837
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
prompt: |
4040
REPO: ${{ github.repository }}
4141
PR NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)