Skip to content

Commit

Permalink
ci(win): workaround for broken curl 8.8.0 --write-out opt in gha images
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 12, 2024
1 parent 6292535 commit b16530a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion script/lib/download-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ function download_to {
OUTPUT_FILE="$2"
debug_log "doing curl of: '$URL', saving in $OUTPUT_FILE"

HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
if [[ "$(uname -m)" == "Darwin" ]] || [[ "$(uname -m)" == "Linux" ]]; then
HTTP_CODE="$(curl --silent --output "$OUTPUT_FILE" --write-out "%{http_code}" --location "$URL")"
else
# temp workaround for curl 8.8.x error on windows gha runners
# https://github.com/curl/curl/issues/13845
curl --silent --output "$OUTPUT_FILE" --location "$URL"
if [ $? -ne 0 ]; then
error "Unable to download file at url ${URL}"
exit 1
else
HTTP_CODE=200
fi
fi
debug_log "did curl, http code was '${HTTP_CODE}'"
if [[ "${HTTP_CODE}" -lt 200 || "${HTTP_CODE}" -gt 299 ]] ; then
error "Unable to download file at url ${URL}"
Expand Down

0 comments on commit b16530a

Please sign in to comment.