Skip to content

Commit 0a1e232

Browse files
knowledgecodeclaude
andcommitted
Fix coverage badge color condition using fromJSON
Use fromJSON() to properly convert string percentage to number for color threshold comparison in GitHub Actions expressions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8988fba commit 0a1e232

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
with:
6363
label: 'coverage'
6464
status: ${{ steps.coverage.outputs.pct }}%
65-
color: ${{ steps.coverage.outputs.pct > 80 && 'brightgreen' || steps.coverage.outputs.pct > 60 && 'yellow' || 'red' }}
65+
color: ${{ fromJSON(steps.coverage.outputs.pct) >= 80 && 'brightgreen' || fromJSON(steps.coverage.outputs.pct) >= 60 && 'yellow' || 'red' }}
6666
path: badges/coverage.svg
6767
style: flat
6868

0 commit comments

Comments
 (0)