Skip to content

Commit b608360

Browse files
Gist JSON population update.
1 parent db68e06 commit b608360

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/ci-tests.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ jobs:
7171
run: |
7272
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; print(round(float(ET.parse('coverage_quick.xml').getroot().attrib['line-rate'])*100))")
7373
echo "percentage=$COVERAGE" >> $GITHUB_OUTPUT
74+
# Determine badge color based on coverage percentage
75+
if [ $COVERAGE -ge 80 ]; then
76+
echo "color=success" >> $GITHUB_OUTPUT
77+
elif [ $COVERAGE -ge 60 ]; then
78+
echo "color=yellow" >> $GITHUB_OUTPUT
79+
else
80+
echo "color=critical" >> $GITHUB_OUTPUT
81+
fi
7482
7583
- name: Update coverage badge
7684
uses: schneegans/dynamic-badges-action@v1.7.0
@@ -80,7 +88,7 @@ jobs:
8088
filename: coverage.json
8189
label: coverage
8290
message: ${{ steps.get_coverage.outputs.percentage }}%
83-
color: $([ ${{ steps.get_coverage.outputs.percentage }} -ge 80 ] && echo 'success' || ([ ${{ steps.get_coverage.outputs.percentage }} -ge 60 ] && echo 'yellow' || echo 'critical'))
91+
color: ${{ steps.get_coverage.outputs.color }}
8492

8593
env:
8694
CONTEXTGEM_OPENAI_API_KEY: ${{ secrets.CONTEXTGEM_OPENAI_API_KEY }}

0 commit comments

Comments
 (0)