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.
This commit is contained in:
Mark Evenson 2023-08-02 10:31:29 +02:00
parent 34dba08b7a
commit b981227c9f
1 changed files with 5 additions and 2 deletions

View File

@ -41,8 +41,11 @@ BOTTLE_PATH="/tmp/${BOTTLE_NAME}.tar.gz"
# GitHub Packages requires authentication. # GitHub Packages requires authentication.
GITHUB_USER="${GITHUB_USER:-_}" GITHUB_USER="${GITHUB_USER:-_}"
GITHUB_TOKEN="${GITHUB_TOKEN:-_}" GITHUB_TOKEN="${GITHUB_TOKEN:-_}"
if [[ "${GITHUB_USER}" == "_" ]] || [[ "${GITHUB_TOKEN}" == "_" ]]; then if [[ "${GITHUB_USER}" == "_" ]]; then
echo "No GITHUB_USER or GITHUB_TOKEN variable set!" >&2 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 echo "GitHub Packages can throttle unauthorized requests." >&2
else else
echo "${BOTTLE_NAME} - Fetching GH Pkgs Token" echo "${BOTTLE_NAME} - Fetching GH Pkgs Token"