From 835762b289517b3311449a0976add733a91db3b1 Mon Sep 17 00:00:00 2001 From: Sharon Azriel <150116802+sazriel26@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:51:59 +0200 Subject: [PATCH] Ready for review? --- Library/Homebrew/cmd/update.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index b3e2246463..18c97239a6 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -645,15 +645,15 @@ EOS if [[ -n "${UPSTREAM_REPOSITORY}" ]] then + # UPSTREAM_REPOSITORY_TOKEN is parsed (if exists) from UPSTREAM_REPOSITORY_URL # HOMEBREW_GITHUB_API_TOKEN is optionally defined in the user environment. - # Global token HOMEBREW_GITHUB_API_TOKEN supersedes local defined one # shellcheck disable=SC2153 - if [[ -n "${HOMEBREW_GITHUB_API_TOKEN}" ]] - then - CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${HOMEBREW_GITHUB_API_TOKEN}") - elif [[ -n "${UPSTREAM_REPOSITORY_TOKEN}" ]] + if [[ -n "${UPSTREAM_REPOSITORY_TOKEN}" ]] then CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${UPSTREAM_REPOSITORY_TOKEN}") + elif [[ -n "${HOMEBREW_GITHUB_API_TOKEN}" ]] + then + CURL_GITHUB_API_ARGS=("--header" "Authorization: token ${HOMEBREW_GITHUB_API_TOKEN}") else CURL_GITHUB_API_ARGS=() fi