From 38727523385194b5a0af539fe7e33cf399bfb668 Mon Sep 17 00:00:00 2001 From: "Vinicius D. Cerutti" <51954708+viniciusdc@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:54:46 -0300 Subject: [PATCH] chore: add bad-credentials exception for install script * fix typo at closing if statement --- hack/install_kustomize.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index 2b7ae3d1cb..a5ac331ab1 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -141,6 +141,10 @@ else releases=$(curl -s "$release_url" --header "Authorization: Bearer ${GITHUB_TOKEN}") fi +if [[ $releases == *"Bad credentials"* ]]; then + echo "Authentication failed: Invalid GITHUB_TOKEN. Please check or remove your token." + exit 1 +fi if [[ $releases == *"API rate limit exceeded"* ]]; then echo "Github rate-limiter failed the request. Either authenticate or wait a couple of minutes." exit 1