Skip to content

Instantly share code, notes, and snippets.

@viggin543
Created September 18, 2020 20:04
Show Gist options
  • Save viggin543/9c0efb27d6bece85ac7be9a88b5aa4e3 to your computer and use it in GitHub Desktop.
Save viggin543/9c0efb27d6bece85ac7be9a88b5aa4e3 to your computer and use it in GitHub Desktop.
# Generate a badge
# run your tests... get the $total of covared lines and calculate the COLOR of youe badge
# for example if (( $total < 50 )) ;then COLOR=RED ;done
curl "https://img.shields.io/badge/coavrege-$total%25-$COLOR" > badge.svg
gsutil -h "Cache-Control: no-cache" cp badge.svg gs://$SOME_BACKET/$PROJECT_NAME/codcov.svg
gsutil acl ch -u AllUsers:R gs://$SOME_BACKET/$PROJECT_NAME/codcov.svg
#REPLACE $SOME_BUCKET and $PROJECT_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment