Don't bother api.github.com on pull requests to avoid getting rate limited (#10709)

(cherry picked from commit c0389ef82f)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2020-06-18 23:55:09 +00:00
committed by GitHub
parent ec1f2b4f90
commit 248ab3a6ec

View File

@ -5,12 +5,16 @@ cd "$(dirname "$0")"
if [[ -n $CI_TAG ]]; then if [[ -n $CI_TAG ]]; then
LATEST_SOLANA_RELEASE_VERSION=$CI_TAG LATEST_SOLANA_RELEASE_VERSION=$CI_TAG
else elif [[ -z $CI_PULL_REQUEST ]]; then
LATEST_SOLANA_RELEASE_VERSION=$(\ LATEST_SOLANA_RELEASE_VERSION=$(\
curl -sSfL https://api.github.com/repos/solana-labs/solana/releases/latest \ curl -sSfL https://api.github.com/repos/solana-labs/solana/releases/latest \
| grep -m 1 tag_name \ | grep -m 1 tag_name \
| sed -ne 's/^ *"tag_name": "\([^"]*\)",$/\1/p' \ | 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 fi
set -x set -x