From 3c44db87468e755ba76c52a2fef1da7da0c10e9f Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 23 Dec 2022 01:34:54 -0700 Subject: [PATCH] add GitHub token to install_kustomize.sh Signed-off-by: vsoch --- hack/install_kustomize.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index 25ae450c0..2b7ae3d1c 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -134,7 +134,12 @@ s390x) ;; esac -releases=$(curl -s "$release_url") +# You can authenticate by exporting the GITHUB_TOKEN in the environment +if [[ -z "${GITHUB_TOKEN}" ]]; then + releases=$(curl -s "$release_url") +else + releases=$(curl -s "$release_url" --header "Authorization: Bearer ${GITHUB_TOKEN}") +fi if [[ $releases == *"API rate limit exceeded"* ]]; then echo "Github rate-limiter failed the request. Either authenticate or wait a couple of minutes."