File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 4848# --- 3. Resolve latest install_only tarball URL ---
4949echo " Resolving latest python-build-standalone ($TRIPLE ) ..."
5050API_URL=" https://api.github.com/repos/$REPO /releases/latest"
51+ # Use GITHUB_TOKEN in CI to avoid rate limits (unauthenticated = 60/hr)
52+ CURL_API=(curl -sL)
53+ if [ -n " ${GITHUB_TOKEN:- } " ]; then
54+ CURL_API+=(-H " Authorization: Bearer $GITHUB_TOKEN " )
55+ fi
5156if command -v jq & > /dev/null; then
5257 # (.assets // []) handles API errors or rate limits where .assets may be null
53- ASSET_URL=$( curl -sL " $API_URL " | jq -r --arg t " $TRIPLE " ' (.assets // [])[] | select(.name | test("install_only")) | select(.name | test($t)) | .browser_download_url' | head -1)
58+ ASSET_URL=$( " ${CURL_API[@]} " " $API_URL " | jq -r --arg t " $TRIPLE " ' (.assets // [])[] | select(.name | test("install_only")) | select(.name | test($t)) | .browser_download_url' | head -1)
5459else
55- ASSET_URL=$( curl -sL " $API_URL " | grep -o ' "browser_download_url": "[^"]*install_only[^"]*' " $TRIPLE " ' [^"]*"' | head -1 | sed ' s/.*: "\(.*\)".*/\1/' )
60+ ASSET_URL=$( " ${CURL_API[@]} " " $API_URL " | grep -o ' "browser_download_url": "[^"]*install_only[^"]*' " $TRIPLE " ' [^"]*"' | head -1 | sed ' s/.*: "\(.*\)".*/\1/' )
5661fi
5762if [ -z " $ASSET_URL " ] || [ " $ASSET_URL " = " null" ]; then
5863 echo " Could not find install_only asset for $TRIPLE . Check https://github.com/$REPO /releases"
You can’t perform that action at this time.
0 commit comments