-
-
Save ferPrieto/bbc86185ac5d77f1ba2d067a125bd551 to your computer and use it in GitHub Desktop.
This piece of code gets the percentages from both secrets and Jacoco report
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
# Get master branch code-coverage value (from secrets) | |
curl -X GET 'https://api.bitrise.io/v0.1/apps/$APP_ID/secrets/CODE_COVERAGE/value' \ | |
-H 'accept: application/json' \ | |
-H 'Authorization: '"${BITRISE_PERSONAL_ACCESS_TOKEN}"'' \ | |
-H 'Content-Type: application/json' > current-code-coverage.json | |
MASTER_BRANCH_CODE_COVERAGE=`jq -r '.value' current-code-coverage.json` | |
# Parse current code-coverage value (from the Jacoco report) | |
chmod +x $BITRISE_SOURCE_DIR/build/reports/jacoco/index.html | |
CURRENT_COVERAGE=$(cat $BITRISE_SOURCE_DIR/build/reports/jacoco/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total//') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment