Use PAT for API call to prevent throttling

This commit is contained in:
Angela P Wen
2025-04-25 11:43:01 -07:00
parent b945f6e061
commit 22826037a5

View File

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