1
0
Fork 0
mirror of https://github.com/rbenv/ruby-build.git synced 2025-06-13 15:28:05 +02:00

Verify checksums for pull requests from other people

This has the CI step verify the checksums for URLs that might have been
added or edited to build definitions in a pull request.
This commit is contained in:
Mislav Marohnić 2014-09-08 09:14:43 -07:00
parent bff583b247
commit 3add5c4637
2 changed files with 15 additions and 0 deletions

View file

@ -64,6 +64,19 @@ update() {
done
}
verify() {
local url
local checksum
local file
for url in $(potentially_new_packages "$1"); do
checksum="${url#*#}"
url="${url%#*}"
echo "Verifying checksum for $url"
file="${TMPDIR:-/tmp}/$checksum"
download_and_verify "$url" "$file" "$checksum"
done
}
stats() {
local packages=( $(extract_urls ./share/ruby-build/*) )
local total="${#packages[@]}"

View file

@ -8,6 +8,8 @@ bats -t test || STATUS="$?"
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then
./script/mirror update "$TRAVIS_COMMIT_RANGE"
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
./script/mirror verify "$TRAVIS_COMMIT_RANGE"
fi
exit "$STATUS"