Skip to content

Commit

Permalink
chore: Align coverage badge colors with GitLab. (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Sep 5, 2023
1 parent e2158e6 commit 88eed85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions scripts/generate-coverage-badge.sh
@@ -1,12 +1,16 @@
#!/bin/bash

TOTAL_COVERAGE=$(coverage report --format=total)
COLOR="red"
COLOR="#9f9f9f"

if [ "$TOTAL_COVERAGE" -gt 90 ]; then
COLOR="green"
if [ "$TOTAL_COVERAGE" -gt 95 ]; then
COLOR="#4c1"
elif [ "$TOTAL_COVERAGE" -gt 90 ]; then
COLOR="#a3c51c"
elif [ "$TOTAL_COVERAGE" -gt 75 ]; then
COLOR="yellow"
COLOR="#dfb317"
elif [ "$TOTAL_COVERAGE" -gt 0 ]; then
COLOR="#e05d44"
fi

cat << EOF > "${1:-.}/coverage_badge.json"
Expand Down
12 changes: 8 additions & 4 deletions template/scripts/generate-coverage-badge.sh
@@ -1,12 +1,16 @@
#!/bin/bash

TOTAL_COVERAGE=$(coverage report --format=total)
COLOR="red"
COLOR="#9f9f9f"

if [ "$TOTAL_COVERAGE" -gt 90 ]; then
COLOR="green"
if [ "$TOTAL_COVERAGE" -gt 95 ]; then
COLOR="#4c1"
elif [ "$TOTAL_COVERAGE" -gt 90 ]; then
COLOR="#a3c51c"
elif [ "$TOTAL_COVERAGE" -gt 75 ]; then
COLOR="yellow"
COLOR="#dfb317"
elif [ "$TOTAL_COVERAGE" -gt 0 ]; then
COLOR="#e05d44"
fi

cat << EOF > "${1:-.}/coverage_badge.json"
Expand Down

0 comments on commit 88eed85

Please sign in to comment.