diff --git a/action.yml b/action.yml index 40742f9..5de7541 100644 --- a/action.yml +++ b/action.yml @@ -110,12 +110,17 @@ runs: (set -x; wget --spider --timeout=5 --header='Accept: */*' https://github.com/mikefarah/yq/releases/latest 2>&1 | grep 'Location:' | awk '{print $2}') (set -x; wget --spider --timeout=5 --header='Accept: */*' https://github.com/mikefarah/yq/releases/latest 2>&1 | grep 'Location:' | awk '{print $2}' | grep -o '[^/]*$') (set -x; wget --spider --timeout=5 --header='Accept: */*' https://github.com/mikefarah/yq/releases/latest 2>&1 | grep 'Location:' | awk '{print $2}' | grep -o '[^/]*$' | cut -c2-) - + function get_latest_version() { - # currently broken because of https://github.com/curl/curl/issues/13845 - # (set -x; curl -sSfL --max-time 5 -o /dev/null -w '%{url_effective}' $APP_REPO_ROOT/releases/latest | grep -o '[^/]*$' | cut -c2-) + # temporary workaround for https://github.com/curl/curl/issues/13845 + if [[ $RUNNER_OS == "Windows" ]]; then + Windows) + (set -x; powershell -Command "(Invoke-WebRequest -Uri '$APP_REPO_ROOT/releases/latest' -Method Head -MaximumRedirection 0 -ErrorAction Ignore -UseBasicParsing).Headers.Location") + ;; + return + fi - (set -x; wget --spider --timeout=5 --header='Accept: */*' https://github.com/mikefarah/yq/releases/latest 2>&1 | grep 'Location:' | awk '{print $2}' | grep -o '[^/]*$' | cut -c2-) + (set -x; curl -sSfL --max-time 5 -o /dev/null -w '%{url_effective}' $APP_REPO_ROOT/releases/latest | grep -o '[^/]*$' | cut -c2-) } app_downloaded=false