From b981227c9f6b96ccee01547d4d9827487e602b6f Mon Sep 17 00:00:00 2001 From: Mark Evenson Date: Wed, 2 Aug 2023 10:31:29 +0200 Subject: [PATCH] build: clarify error conditions for github token Under macOS, the error message "No GITHUB_USER or GITHUB_TOKEN variable set!" is confusing as both variables are required to be set. --- scripts/fetch-brew-bottle.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-brew-bottle.sh b/scripts/fetch-brew-bottle.sh index 56c646824f..a4017012b8 100755 --- a/scripts/fetch-brew-bottle.sh +++ b/scripts/fetch-brew-bottle.sh @@ -41,8 +41,11 @@ BOTTLE_PATH="/tmp/${BOTTLE_NAME}.tar.gz" # GitHub Packages requires authentication. GITHUB_USER="${GITHUB_USER:-_}" GITHUB_TOKEN="${GITHUB_TOKEN:-_}" -if [[ "${GITHUB_USER}" == "_" ]] || [[ "${GITHUB_TOKEN}" == "_" ]]; then - echo "No GITHUB_USER or GITHUB_TOKEN variable set!" >&2 +if [[ "${GITHUB_USER}" == "_" ]]; then + echo "No GITHUB_USER variable set!" >&2 + echo "GitHub Packages can throttle unauthorized requests." >&2 +elif [[ "${GITHUB_TOKEN}" == "_" ]]; then + echo "No GITHUB_TOKEN variable set!" >&2 echo "GitHub Packages can throttle unauthorized requests." >&2 else echo "${BOTTLE_NAME} - Fetching GH Pkgs Token"