Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,37 @@ jobs:
script: |
const pr_number = context.payload.pull_request.number;

// Check if Claude review has been completed
// 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 has_claude_review = comments.data.some(comment =>
comment.body.includes('Claude AI Review') ||
comment.body.includes('Claude review completed')
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') &&
comment.body.includes('Claude is reviewing')
);

// Check for actual review with Claude AI approval/feedback
const has_review = reviews.data.some(review =>
review.body && (
review.body.includes('Claude AI approved') ||
review.body.includes('Claude AI review')
)
);

const has_claude_review = has_automated_checks && has_review;

if (!has_claude_review) {
core.setFailed('⚠️ Claude review required for merging to main. Comment "/claude review" to trigger.');
} else {
Expand Down
15 changes: 15 additions & 0 deletions TEST_AUTO_APPROVE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Test Auto-Approve Workflow

This is a test to verify the auto-approve workflow with the new ORG_GITHUB_TOKEN.

## Expected Behavior:
1. ✅ Claude Auto Review should run automatically
2. ✅ PR should get auto-approved if checks pass
3. ✅ "Require Claude Review for Main" should pass (now checks for actual review text)
4. ✅ Auto-merge should be enabled

## Token Setup:
- `ORG_GITHUB_TOKEN` is configured and working
- Token has `pull_requests: read and write` permission
- Token is scoped to this repository only

Loading