File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 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
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
8593env :
8694 CONTEXTGEM_OPENAI_API_KEY : ${{ secrets.CONTEXTGEM_OPENAI_API_KEY }}
You can’t perform that action at this time.
0 commit comments