Summary
Three gaps in the claude-code-reusable.yml workflow prevent Claude from automatically fixing PR issues raised by trusted bots and CI checks:
claude-ci-fix is broken — check_run is not a supported event type in claude-code-action; every triggered run fails with Action failed with error: Unsupported event type: check_run.
- Bot PR reviews are silently ignored — Copilot and Gemini submit
pull_request_review events; no job handles them, and pull_request_review is missing from the caller template's on: triggers entirely.
- Trusted-bot PR comments are blocked — External bots (e.g.
sonarqubecloud[bot], coderabbitai[bot]) post issue_comment events; the claude job's author_association guard (requires OWNER/MEMBER/COLLABORATOR) silently skips them.
Observed failures (2026-05-14)
| Run |
Event |
Result |
Root cause |
| 25884853943 |
check_run (SonarCloud failure on PR #175) |
❌ Failed |
Unsupported event type: check_run |
| 25884855716 |
issue_comment by sonarqubecloud[bot] |
⏭ Skipped |
author_association == "NONE" |
| PR #175 |
Copilot + Gemini reviews submitted |
🔕 Never triggered |
pull_request_review not in on: triggers |
Root Causes
1. check_run not supported by claude-code-action
The action's parseGitHubContext() uses a switch over supported event names. check_run hits the default branch and throws:
Unsupported event type: check_run
Supported event types are: issues, issue_comment, pull_request, pull_request_review, pull_request_review_comment, workflow_dispatch, repository_dispatch, schedule, workflow_run.
The claude-ci-fix job's PR-resolution step works correctly, but the action invocation always fails before Claude runs.
2. pull_request_review missing from trigger list and reusable
When Copilot (copilot-pull-request-reviewer[bot]) or Gemini (gemini-code-assist[bot]) submits a PR review, GitHub fires a pull_request_review event. claude-code-action does support this event natively (including automation mode via prompt: with allowed_bots:). However:
- The caller template (
standards/workflows/claude.yml) has no pull_request_review entry in on:.
- The reusable has no job with
github.event_name == 'pull_request_review' from a bot.
Result: the webhook fires, no workflow job runs.
Verified on PR #175: both Copilot and Gemini left top-level pull_request_review events (not inline pull_request_review_comment events), so the existing claude-fix-review-comments job never fired either.
3. Bot issue_comment blocked by author_association guard
The claude job requires:
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
GitHub App bots always have author_association: "NONE". The claude-code-action exposes an allowed_bots: input that bypasses the permission check for named bots — this is the correct mechanism, but no job uses it for issue_comment events from external bots.
Proposed Solution
Fix A — Replace check_run with workflow_run for GitHub Actions CI (+ bot comment for external CI)
workflow_run is a supported automation event in claude-code-action. It fires when any named GitHub Actions workflow completes and provides pull_requests[0].number directly.
Reusable change — replace claude-ci-fix's if: condition:
claude-ci-fix:
if: >-
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.pull_requests[0] != null &&
github.event.workflow_run.repository.full_name == github.repository
concurrency:
group: claude-ci-fix-${{ github.event.workflow_run.head_sha }}
cancel-in-progress: true
...
steps:
- uses: anthropics/claude-code-action@...
with:
prompt: |
The CI workflow "${{ github.event.workflow_run.name }}" failed on PR
#${{ github.event.workflow_run.pull_requests[0].number }}.
Head SHA: ${{ github.event.workflow_run.head_sha }}
Run URL: ${{ github.event.workflow_run.html_url }}
Diagnose and fix the failure. Check out the PR branch, read the failed
logs via `gh run view ${{ github.event.workflow_run.id }} --log-failed`,
apply the minimal fix, commit, push, and comment on the PR.
Caller template change — replace check_run with workflow_run in standards/workflows/claude.yml:
on:
# ... existing triggers ...
workflow_run:
# List CI workflow names for this repo that Claude should monitor:
workflows: ["SonarCloud Analysis", "test", "CI"]
types: [completed]
For external CI app checks (e.g. SonarCloud App, which posts a check_run directly without a GitHub Actions workflow), the bot also posts a detailed issue_comment — this is handled by Fix C below.
Fix B — Add pull_request_review handling for trusted bot reviewers
Caller template change — add trigger:
on:
pull_request_review:
types: [submitted]
Reusable change — add new job:
claude-fix-pr-reviews:
if: >-
github.event_name == 'pull_request_review' &&
github.event.review.state != 'APPROVED' &&
github.event.pull_request.head.repo.full_name == github.repository &&
contains(
fromJson('["copilot-pull-request-reviewer[bot]","gemini-code-assist[bot]","coderabbitai[bot]"]'),
github.event.review.user.login
)
concurrency:
group: claude-fix-pr-reviews-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
id-token: write
pull-requests: write
issues: write
actions: read
checks: read
steps:
- uses: actions/checkout@...
with:
token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }}
- uses: anthropics/claude-code-action@...
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }}
allowed_bots: "copilot-pull-request-reviewer,gemini-code-assist,coderabbitai"
claude_args: |
--allowedTools "Bash(gh pr checkout:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(git*:*),Edit,Write"
prompt: |
${{ github.event.review.user.login }} submitted a PR review on
PR #${{ github.event.pull_request.number }} (${{ github.event.pull_request.html_url }}).
Review state: ${{ github.event.review.state }}
Review body:
${{ github.event.review.body }}
Your job: address all open (unresolved) review threads on this PR and bring it
to a passing, fully-reviewed state. Follow the same cycle as claude-fix-review-comments:
fetch open threads → apply fixes → commit → resolve threads → wait for CI → repeat.
Note on APPROVED filter: Skip approved reviews — no action needed. Only act on COMMENTED and CHANGES_REQUESTED states.
Fix C — Add issue_comment handling for trusted external-tool bots
Reusable change — add new job:
claude-fix-bot-comments:
if: >-
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.login != 'claude[bot]' &&
contains(
fromJson('["sonarqubecloud[bot]","coderabbitai[bot]"]'),
github.event.comment.user.login
)
concurrency:
group: claude-fix-bot-comment-${{ github.event.issue.number }}-${{ github.event.comment.id }}
cancel-in-progress: false
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: write
id-token: write
pull-requests: write
issues: write
actions: read
checks: read
steps:
- uses: actions/checkout@...
with:
token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }}
- uses: anthropics/claude-code-action@...
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }}
allowed_bots: "sonarqubecloud,coderabbitai"
claude_args: |
--allowedTools "Bash(gh pr checkout:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(git*:*),Edit,Write"
prompt: |
${{ github.event.comment.user.login }} posted the following comment on
PR #${{ github.event.issue.number }}:
---
${{ github.event.comment.body }}
---
Diagnose the reported issues, apply minimal fixes to the PR branch,
commit, push, and leave a comment on the PR summarising what you changed.
Files to Change
| File |
Change |
.github/workflows/claude-code-reusable.yml |
Replace claude-ci-fix's if: for workflow_run; add claude-fix-pr-reviews job; add claude-fix-bot-comments job |
standards/workflows/claude.yml |
Add pull_request_review: [submitted] and workflow_run: [completed] to on: |
All repos consuming claude.yml |
Add repo-specific workflow names under workflow_run.workflows |
Security Considerations
allowed_bots bypasses author_association only for named bots. Wildcard * is not used.
- Fork safety: all three new jobs gate on
head.repo.full_name == github.repository, preventing fork PRs from triggering write-access jobs.
- Concurrency guards:
cancel-in-progress: true prevents cascading runs when multiple bot events arrive in quick succession.
- Bot allowlists: named explicitly (
copilot-pull-request-reviewer[bot], gemini-code-assist[bot], sonarqubecloud[bot], coderabbitai[bot]). New bots must be added intentionally.
- OIDC invariant: Adding triggers (
pull_request_review, workflow_run) to claude.yml on main does not violate the OIDC constraint — the constraint is that the file on any PR branch must match main, which is satisfied as long as PRs don't modify claude.yml.
Acceptance Criteria
References
Summary
Three gaps in the
claude-code-reusable.ymlworkflow prevent Claude from automatically fixing PR issues raised by trusted bots and CI checks:claude-ci-fixis broken —check_runis not a supported event type inclaude-code-action; every triggered run fails withAction failed with error: Unsupported event type: check_run.pull_request_reviewevents; no job handles them, andpull_request_reviewis missing from the caller template'son:triggers entirely.sonarqubecloud[bot],coderabbitai[bot]) postissue_commentevents; theclaudejob'sauthor_associationguard (requiresOWNER/MEMBER/COLLABORATOR) silently skips them.Observed failures (2026-05-14)
check_run(SonarCloud failure on PR #175)Unsupported event type: check_runissue_commentbysonarqubecloud[bot]author_association == "NONE"pull_request_reviewnot inon:triggersRoot Causes
1.
check_runnot supported byclaude-code-actionThe action's
parseGitHubContext()uses a switch over supported event names.check_runhits thedefaultbranch and throws:Supported event types are:
issues,issue_comment,pull_request,pull_request_review,pull_request_review_comment,workflow_dispatch,repository_dispatch,schedule,workflow_run.The
claude-ci-fixjob's PR-resolution step works correctly, but the action invocation always fails before Claude runs.2.
pull_request_reviewmissing from trigger list and reusableWhen Copilot (
copilot-pull-request-reviewer[bot]) or Gemini (gemini-code-assist[bot]) submits a PR review, GitHub fires apull_request_reviewevent.claude-code-actiondoes support this event natively (including automation mode viaprompt:withallowed_bots:). However:standards/workflows/claude.yml) has nopull_request_reviewentry inon:.github.event_name == 'pull_request_review'from a bot.Result: the webhook fires, no workflow job runs.
Verified on PR #175: both Copilot and Gemini left top-level
pull_request_reviewevents (not inlinepull_request_review_commentevents), so the existingclaude-fix-review-commentsjob never fired either.3. Bot
issue_commentblocked byauthor_associationguardThe
claudejob requires:contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)GitHub App bots always have
author_association: "NONE". Theclaude-code-actionexposes anallowed_bots:input that bypasses the permission check for named bots — this is the correct mechanism, but no job uses it forissue_commentevents from external bots.Proposed Solution
Fix A — Replace
check_runwithworkflow_runfor GitHub Actions CI (+ bot comment for external CI)workflow_runis a supported automation event inclaude-code-action. It fires when any named GitHub Actions workflow completes and providespull_requests[0].numberdirectly.Reusable change — replace
claude-ci-fix'sif:condition:Caller template change — replace
check_runwithworkflow_runinstandards/workflows/claude.yml:For external CI app checks (e.g. SonarCloud App, which posts a
check_rundirectly without a GitHub Actions workflow), the bot also posts a detailedissue_comment— this is handled by Fix C below.Fix B — Add
pull_request_reviewhandling for trusted bot reviewersCaller template change — add trigger:
Reusable change — add new job:
Note on
APPROVEDfilter: Skip approved reviews — no action needed. Only act onCOMMENTEDandCHANGES_REQUESTEDstates.Fix C — Add
issue_commenthandling for trusted external-tool botsReusable change — add new job:
Files to Change
.github/workflows/claude-code-reusable.ymlclaude-ci-fix'sif:forworkflow_run; addclaude-fix-pr-reviewsjob; addclaude-fix-bot-commentsjobstandards/workflows/claude.ymlpull_request_review: [submitted]andworkflow_run: [completed]toon:claude.ymlworkflow_run.workflowsSecurity Considerations
allowed_botsbypassesauthor_associationonly for named bots. Wildcard*is not used.head.repo.full_name == github.repository, preventing fork PRs from triggering write-access jobs.cancel-in-progress: trueprevents cascading runs when multiple bot events arrive in quick succession.copilot-pull-request-reviewer[bot],gemini-code-assist[bot],sonarqubecloud[bot],coderabbitai[bot]). New bots must be added intentionally.pull_request_review,workflow_run) toclaude.ymlonmaindoes not violate the OIDC constraint — the constraint is that the file on any PR branch must matchmain, which is satisfied as long as PRs don't modifyclaude.yml.Acceptance Criteria
COMMENTEDorCHANGES_REQUESTED) triggers Claude to address all open threadssonarqubecloud[bot]quality gate comment triggers Claude to fix the reported issuesclaude-ci-fixno longer produces "Unsupported event type: check_run" errorsReferences
claude-code-actionsupported event typesallowed_botsinput docs