-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (43 loc) · 1.75 KB
/
coverage-status-check.yml
File metadata and controls
54 lines (43 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Coverage Status Check - DISABLED
on:
workflow_dispatch:
jobs:
coverage-gate:
name: Coverage Gate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Wait for coverage check
timeout-minutes: 10
run: |
echo "Waiting for Code Coverage Check to complete..."
# Wait up to 10 minutes for the check to appear and complete
for i in {1..60}; do
# Get the status of the Code Coverage Check
STATUS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs \
--jq '.check_runs[] | select(.name == "Code Coverage Check") | .status' || echo "")
CONCLUSION=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs \
--jq '.check_runs[] | select(.name == "Code Coverage Check") | .conclusion' || echo "")
if [ -n "$STATUS" ]; then
echo "Check found with status: $STATUS, conclusion: $CONCLUSION"
if [ "$STATUS" == "completed" ]; then
if [ "$CONCLUSION" == "success" ]; then
echo "✅ Code coverage check passed!"
exit 0
else
echo "❌ Code coverage check failed with conclusion: $CONCLUSION"
exit 1
fi
fi
else
echo "Check not found yet (attempt $i/60)"
fi
sleep 10
done
echo "❌ Timeout waiting for Code Coverage Check"
exit 1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coverage gate passed
run: echo "✅ Code coverage requirements met!"