Skip to content

Commit 312e5c9

Browse files
fix(ci): check claude[bot] comment for auto-approve
Claude Code Action posts a comment with 'No issues found. Checked for bugs and CLAUDE.md compliance.' when review passes. Check for this comment instead of check run output fields which are not set. Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent 49ce9d5 commit 312e5c9

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/auto-approve.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ jobs:
5050
HEAD_SHA=$(gh api repos/${{ github.repository }}/pulls/$PR_NUMBER --jq '.head.sha')
5151
echo "Head SHA: $HEAD_SHA"
5252
53-
# Check Claude review status and output
54-
CLAUDE_CHECK=$(gh api repos/${{ github.repository }}/commits/$HEAD_SHA/check-runs --jq '.check_runs[] | select(.name == "claude-review")')
55-
CLAUDE_STATUS=$(echo "$CLAUDE_CHECK" | jq -r '.conclusion' | head -1)
56-
CLAUDE_OUTPUT=$(echo "$CLAUDE_CHECK" | jq -r '.output.summary // .output.text // ""' | head -1)
57-
echo "Claude review status: $CLAUDE_STATUS"
58-
echo "Claude review output: $CLAUDE_OUTPUT"
59-
60-
# Check if Claude found no issues (exact message check)
53+
# Check Claude review - look for "No issues found" comment from claude[bot]
54+
# Claude posts a comment with this exact message when review passes
55+
CLAUDE_COMMENTS=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '[.[] | select(.user.login == "claude[bot]") | .body] | join("\n")')
56+
6157
CLAUDE_APPROVED="false"
62-
if [ "$CLAUDE_STATUS" == "success" ] && echo "$CLAUDE_OUTPUT" | grep -q "No issues found. Checked for bugs and CLAUDE.md compliance"; then
58+
if echo "$CLAUDE_COMMENTS" | grep -q "No issues found. Checked for bugs and CLAUDE.md compliance"; then
59+
echo "Claude review found: No issues"
6360
CLAUDE_APPROVED="true"
61+
else
62+
echo "Claude review: Issues found or review not complete"
63+
# Check if claude-review check status for debugging
64+
CLAUDE_STATUS=$(gh api repos/${{ github.repository }}/commits/$HEAD_SHA/check-runs --jq '.check_runs[] | select(.name == "claude-review") | .conclusion' | head -1)
65+
echo "Claude review check status: $CLAUDE_STATUS"
6466
fi
6567
echo "Claude approved: $CLAUDE_APPROVED"
6668

0 commit comments

Comments
 (0)