From 22826037a5ce87e65f37ceef0c4714ad04f18c8c Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 25 Apr 2025 11:43:01 -0700 Subject: [PATCH] Use PAT for API call to prevent throttling --- images/macos/scripts/build/install-codeql-bundle.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/macos/scripts/build/install-codeql-bundle.sh b/images/macos/scripts/build/install-codeql-bundle.sh index 18fb2075b..f1d70a121 100644 --- a/images/macos/scripts/build/install-codeql-bundle.sh +++ b/images/macos/scripts/build/install-codeql-bundle.sh @@ -7,7 +7,8 @@ source ~/utils/utils.sh # Retrieve the latest major version of the CodeQL Action to use in the base URL for downloading the bundle. -releases=$(curl -s "https://api.github.com/repos/github/codeql-action/releases") +[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") +releases=$(curl "${authString[@]}" -s "https://api.github.com/repos/github/codeql-action/releases") # Get the release tags starting with v[0-9] and sort them in descending order, then parse the first one to get the major version. codeql_action_latest_major_version=$(echo "$releases" |