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" |