Created
January 17, 2023 12:04
-
-
Save GitHub30/caacfc861fba320597f620fecd5b320c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/dbrgn/coverage-badge/blob/ea399fc586eb00ec7f77e355a2e4b2b7cebd24c1/tests/test_output.py#L49 | |
p=$(printf %.0f $(grep -Pom1 '(?<=aria-valuenow=").*?(?=")' reports/index.html)) | |
color=$([[ $p -gt 96 ]] && echo 4c1 || ([[ $p -gt 92 ]] && echo 97CA00 || ([[ $p -gt 79 ]] && echo a4a61d || ([[ $p -gt 64 ]] && echo dfb317 || ([[ $p -gt 44 ]] && echo fe7d37 || ([[ $p -gt 14 ]] && echo e05d44 || echo 9f9f9f)))))) | |
wget -O reports/badge.svg https://shields.io/badge/coverage-$p%25-$color?logo=github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment