Skip to content

Commit bd46b58

Browse files
fix(ci): address Copilot review feedback and skip tests for CI-only changes
- Check Copilot review existence before checking comments (fixes race condition) - Only trigger Unity tests for unity-tests.yml and pr-tests.yml changes - Other CI workflow changes (auto-approve, etc.) no longer run Unity tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent 3c9dddc commit bd46b58

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/auto-approve.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ jobs:
5050
HEAD_SHA=$(gh api repos/${{ github.repository }}/pulls/$PR_NUMBER --jq '.head.sha')
5151
echo "Head SHA: $HEAD_SHA"
5252
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
53+
# Check Copilot review - must verify Copilot has actually reviewed first
54+
# Copilot leaves "COMMENTED" reviews (never "APPROVED" or "CHANGES_REQUESTED")
55+
# We need to: 1) Confirm a review exists, 2) Check for inline comments
56+
COPILOT_REVIEW=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/reviews" --jq '[.[] | select(.user.login == "copilot[bot]")] | length')
5657
COPILOT_COMMENTS=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER/comments" --jq '[.[] | select(.user.login == "copilot[bot]")] | length')
5758
5859
COPILOT_OK="false"
59-
if [ "$COPILOT_COMMENTS" -eq 0 ]; then
60-
echo "Copilot review: No issues found (0 inline comments)"
60+
if [ "$COPILOT_REVIEW" -eq 0 ]; then
61+
echo "Copilot review: Not yet reviewed (no review found)"
62+
elif [ "$COPILOT_COMMENTS" -eq 0 ]; then
63+
echo "Copilot review: Reviewed with no issues (0 inline comments)"
6164
COPILOT_OK="true"
6265
else
6366
echo "Copilot review: Found $COPILOT_COMMENTS inline comments - issues need addressing"

.github/workflows/pr-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
- 'UnityProject/Packages/com.jasonxudeveloper.jengine.core/**'
3939
- 'UnityProject/Packages/com.jasonxudeveloper.jengine.util/**'
4040
- 'UnityProject/Assets/Tests/**'
41-
- '.github/workflows/**'
41+
- '.github/workflows/unity-tests.yml'
42+
- '.github/workflows/pr-tests.yml'
4243
4344
run-tests:
4445
name: Run Unity Tests

0 commit comments

Comments
 (0)