Skip to content

fix(ci): update require-claude check to match actual review text#11

Merged
mikkihugo merged 2 commits intomainfrom
test/verify-auto-approve
Nov 11, 2025
Merged

fix(ci): update require-claude check to match actual review text#11
mikkihugo merged 2 commits intomainfrom
test/verify-auto-approve

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Analyzing changes...

Commits:

  • fix(ci): update require-claude check to match actual review text

Changed Files:

.github/workflows/claude-review.yml | 27 +++++++++++++++++++++++----
TEST_AUTO_APPROVE.md | 10 ++++++++++
2 files changed, 33 insertions(+), 4 deletions(-)

Detailed Changes:

- Check for '🔍 Automated Checks' comment
- Check for actual PR review with 'Claude AI approved' or 'Claude AI review'
- Both must be present for the check to pass
- Add test file to verify auto-approve workflow
@mikkihugo
Copy link
Copy Markdown
Contributor

Triggering workflows - testing auto-approve with ORG_GITHUB_TOKEN

@qodo-code-review
Copy link
Copy Markdown

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: Require Claude Review for Main

Failed stage: Check for Claude review [❌]

Failure summary:

The action failed because it enforced a required Claude AI review but did not find one:
- The script
checked for an "Automated Checks" comment indicating Claude is reviewing (comment.body.includes('🔍
Automated Checks') && comment.body.includes('Claude is reviewing')).
- It also searched PR reviews
for a body containing either Claude AI approved or Claude AI review.
- The combined condition
has_claude_review was false, so the action called core.setFailed('⚠️ Claude review required for
merging to main. Comment "/claude review" to trigger.'), causing the job to fail.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

50:    comment.body.includes('🔍 Automated Checks') &&
51:    comment.body.includes('Claude is reviewing')
52:  );
53:  
54:  // Check for actual review with Claude AI approval/feedback
55:  const has_review = reviews.data.some(review =>
56:    review.body && (
57:      review.body.includes('Claude AI approved') ||
58:      review.body.includes('Claude AI review')
59:    )
60:  );
61:  
62:  const has_claude_review = has_automated_checks && has_review;
63:  
64:  if (!has_claude_review) {
65:    core.setFailed('⚠️ Claude review required for merging to main. Comment "/claude review" to trigger.');
66:  } else {
67:    console.log('✅ Claude review found');
68:  }
69:  github-token: ***
70:  debug: false
71:  user-agent: actions/github-script
72:  result-encoding: json
73:  retries: 0
74:  retry-exempt-status-codes: 400,401,403,404,422
75:  ##[endgroup]
76:  ##[error]⚠️ Claude review required for merging to main. Comment "/claude review" to trigger.
77:  Cleaning up orphan processes

@github-actions
Copy link
Copy Markdown
Contributor Author

🔍 Automated Checks

🔍 Checking for stale files and out-of-scope changes...

Stale File Check

✅ No stale files detected

Scope Check

Checking file relevance (blocks binaries, temp files, etc.)...

✅ All changes appear relevant (includes .github/ workflows, src/, docs, config)


Claude is reviewing the code... Check the "Claude Code Review" step for detailed feedback.

Copy link
Copy Markdown
Contributor

@mikkihugo mikkihugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Claude AI approved this PR! All checks passed. Will auto-merge when CI is green.

@mikkihugo mikkihugo enabled auto-merge (squash) November 11, 2025 05:53
@mikkihugo mikkihugo merged commit 6c72790 into main Nov 11, 2025
9 of 10 checks passed
@mikkihugo mikkihugo deleted the test/verify-auto-approve branch November 11, 2025 05:53
@qodo-code-review
Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No audit logs: The workflow script adds logic to verify Claude reviews but does not emit structured audit
logs capturing who triggered the check or its outcome beyond console output, which may be
insufficient for audit trails.

Referred Code
- name: Check for Claude review
  uses: actions/github-script@v7
  with:
    script: |
      const pr_number = context.payload.pull_request.number;

      // Check if Claude review has been completed by looking for:
      // 1. Comments with automated checks from Claude review workflow
      // 2. Actual PR reviews (APPROVED or COMMENT)
      const comments = await github.rest.issues.listComments({
        owner: context.repo.owner,
        repo: context.repo.repo,
        issue_number: pr_number
      });

      const reviews = await github.rest.pulls.listReviews({
        owner: context.repo.owner,
        repo: context.repo.repo,
        pull_number: pr_number
      });



 ... (clipped 20 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Edge cases unhandled: The script assumes API calls succeed and that review/comment bodies exist; it does not
handle API failures, empty arrays, or missing fields beyond default truthiness, which may
cause fragile behavior.

Referred Code
script: |
  const pr_number = context.payload.pull_request.number;

  // Check if Claude review has been completed by looking for:
  // 1. Comments with automated checks from Claude review workflow
  // 2. Actual PR reviews (APPROVED or COMMENT)
  const comments = await github.rest.issues.listComments({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: pr_number
  });

  const reviews = await github.rest.pulls.listReviews({
    owner: context.repo.owner,
    repo: context.repo.repo,
    pull_number: pr_number
  });

  // Check for automated checks comment (posted by Claude Auto Review job)
  const has_automated_checks = comments.data.some(comment =>
    comment.body.includes('🔍 Automated Checks') &&


 ... (clipped 16 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant