Commit 50424e77 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch 'ci/fix-badges-decimal-problem' into 'develop'

[CI][BUGFIX] Round number to have correct badge colors returned

See merge request t3o/ter!607
parents 5cb86fdb 584058be
Pipeline #9914 passed with stages
in 6 minutes and 4 seconds
#!/usr/bin/env bash
# This script is a helper for the anybadge to set the color based on the number result
# Makes sure that we have a , and not a . decimal number
# shellcheck disable=SC2001
n=$(echo "$1" | sed 's/\./,/g')
# Round the number to not have problems with decimals
n=$(echo "$1/1" | bc)
if [[ "$n" -ge "0" ]] && [[ "$n" -lt "50" ]]; then
echo 'red'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment