Skip to content

Commit 3c9dddc

Browse files
feat(ci): migrate from Claude to GitHub Copilot code review
- Remove claude-code-review.yml and claude.yml workflows - Update auto-approve.yml to check Copilot inline comments instead of Claude - Copilot code review is now configured via repository ruleset This change reduces CI costs and avoids potential account suspension from running Claude ~100 times/day across different GitHub runners. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent da89a80 commit 3c9dddc

3 files changed

Lines changed: 15 additions & 115 deletions

File tree

.github/workflows/auto-approve.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
types: [completed]
77
# Also trigger on workflow run completion for reusable workflows
88
workflow_run:
9-
workflows: ["PR Tests", "Claude Code Review"]
9+
workflows: ["PR Tests"]
1010
types: [completed]
1111

1212
permissions: read-all
@@ -50,18 +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 - look for "No issues found" comment from claude[bot]
54-
# Claude posts a PR comment with this 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")')
53+
# Check Copilot review - Copilot leaves "Comment" reviews, not "Approve"
54+
# If Copilot left inline comments, it found issues to address
55+
# No comments = no issues found
56+
COPILOT_COMMENTS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" --jq '[.[] | select(.user.login == "copilot[bot]")] | length')
5657
57-
CLAUDE_APPROVED="false"
58-
if echo "$CLAUDE_COMMENTS" | grep -q "No issues found. Checked for bugs and CLAUDE.md compliance"; then
59-
echo "Claude review: No issues found"
60-
CLAUDE_APPROVED="true"
58+
COPILOT_OK="false"
59+
if [ "$COPILOT_COMMENTS" -eq 0 ]; then
60+
echo "Copilot review: No issues found (0 inline comments)"
61+
COPILOT_OK="true"
6162
else
62-
echo "Claude review: Issues found or not yet complete"
63+
echo "Copilot review: Found $COPILOT_COMMENTS inline comments - issues need addressing"
6364
fi
64-
echo "Claude approved: $CLAUDE_APPROVED"
65+
echo "Copilot OK: $COPILOT_OK"
6566
6667
# Check Unity Tests status (commit status, not check run)
6768
UNITY_STATUS=$(gh api repos/${{ github.repository }}/commits/$HEAD_SHA/status --jq '.statuses[] | select(.context == "Unity Tests") | .state' | head -1)
@@ -77,11 +78,11 @@ jobs:
7778
fi
7879
7980
# Determine if we should approve
80-
if [ "$CLAUDE_APPROVED" == "true" ] && [ "$UNITY_STATUS" == "success" ]; then
81-
echo "All required checks passed and Claude found no issues!"
81+
if [ "$COPILOT_OK" == "true" ] && [ "$UNITY_STATUS" == "success" ]; then
82+
echo "All required checks passed and Copilot found no issues!"
8283
echo "should_approve=true" >> $GITHUB_OUTPUT
8384
else
84-
echo "Required checks not yet passed or Claude found issues"
85+
echo "Required checks not yet passed or Copilot found issues"
8586
echo "should_approve=false" >> $GITHUB_OUTPUT
8687
fi
8788
@@ -111,6 +112,6 @@ jobs:
111112
run: |
112113
PR_NUMBER="${{ steps.pr.outputs.number }}"
113114
114-
gh pr review $PR_NUMBER -R ${{ github.repository }} --approve --body "Auto-approved: Claude review found no issues and Unity Tests passed (or were skipped for non-code changes)."
115+
gh pr review $PR_NUMBER -R ${{ github.repository }} --approve --body "Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes)."
115116
116117
echo "PR #$PR_NUMBER approved!"

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/claude.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)