Skip to content

Commit f58536f

Browse files
Fix: Backend Approval bug (#25492)
* testing backend review * testing again * undo gids * fix url * reverted hard coded api call
1 parent 1d5e5e9 commit f58536f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/require_be_approval.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ env:
2222

2323
jobs:
2424
backend-approval-check:
25+
if: ${{ github.actor != 'github-copilot' }}
2526
name: Succeed if backend approval is confirmed
2627
runs-on: ubuntu-latest
2728
permissions: write-all
28-
29+
2930
steps:
3031
- name: Checkout repository
3132
uses: actions/checkout@v6
@@ -54,13 +55,13 @@ jobs:
5455
5556
# Fetch changed files (handles pagination automatically)
5657
CHANGED_FILES=$(gh api "/repos/${{ github.repository }}/pulls/${PR_NUMBER}/files" \
57-
--paginate --jq '.[].filename')
58+
--paginate --jq '.[] | select(.status != "removed") | .filename')
5859
5960
echo "$CHANGED_FILES" > /tmp/changed_files.txt
6061
FILE_COUNT=$(echo "$CHANGED_FILES" | wc -l)
61-
62+
6263
echo "file_count=${FILE_COUNT}" >> "$GITHUB_OUTPUT"
63-
64+
6465
echo "PR #${PR_NUMBER} Analysis"
6566
echo " Author: $(echo "$PR_DATA" | jq -r '.author')"
6667
echo " Draft: $(echo "$PR_DATA" | jq -r '.draft')"
@@ -87,7 +88,7 @@ jobs:
8788
)
8889
8990
all_files_exempt=true
90-
91+
9192
echo "Analyzing Code Owners"
9293
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
9394
echo ""
@@ -308,7 +309,7 @@ jobs:
308309
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
309310
echo "[PASS] APPROVAL CHECK PASSED"
310311
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
311-
312+
312313
if [[ "${{ steps.approval_status.outputs.exempt }}" == "true" ]]; then
313314
echo ""
314315
echo "PR is exempt from backend approval requirement"
@@ -317,6 +318,6 @@ jobs:
317318
echo ""
318319
echo "Backend approval has been confirmed"
319320
fi
320-
321+
321322
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
322323
exit 0

0 commit comments

Comments
 (0)