Add shasum verification to Codecov Bash Uploader (#6843)

According to https://about.codecov.io/security-update/
This commit is contained in:
Zhenxu Ke 2021-04-26 22:27:56 +08:00 committed by GitHub
parent 9de37243c1
commit dfd7ebdc73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -41,4 +41,13 @@ for exec_data in "${JACOCO_HOME}"/*.exec; do
"${JACOCO_HOME}"/"$exec_data".exec
done
bash <(curl -s https://codecov.io/bash) -X fix -f /tmp/report-*.xml || true
# Download codecov bash uploader and verify the sha sums before using it.
curl -s https://codecov.io/bash > codecov
VERSION=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2)
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM")
done
bash codecov -X fix -f /tmp/report-*.xml || true