Don't bother `api.github.com` on pull requests to avoid getting rate limited

This commit is contained in:
Michael Vines 2020-06-18 16:41:14 -07:00 committed by mergify[bot]
parent 2c029b844b
commit c0389ef82f
1 changed files with 5 additions and 1 deletions

View File

@ -5,12 +5,16 @@ cd "$(dirname "$0")"
if [[ -n $CI_TAG ]]; then
LATEST_SOLANA_RELEASE_VERSION=$CI_TAG
else
elif [[ -z $CI_PULL_REQUEST ]]; then
LATEST_SOLANA_RELEASE_VERSION=$(\
curl -sSfL https://api.github.com/repos/solana-labs/solana/releases/latest \
| grep -m 1 tag_name \
| sed -ne 's/^ *"tag_name": "\([^"]*\)",$/\1/p' \
)
else
# Don't bother the `api.github.com` on pull requests to avoid getting rate
# limited
LATEST_SOLANA_RELEASE_VERSION=unknown-version
fi
if [[ -z "$LATEST_SOLANA_RELEASE_VERSION" ]]; then