From 332c3b965c5262a81427059a3037f53a83a6ef0c Mon Sep 17 00:00:00 2001 From: Rafal Wojdyla Date: Thu, 20 Jun 2024 12:23:28 +0200 Subject: [PATCH] Fail if could not retrieve latest GH Runner version --- action.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.sh b/action.sh index 9166fc8..c1911f7 100755 --- a/action.sh +++ b/action.sh @@ -241,6 +241,10 @@ function start_vm { latest_ver=$(curl -sL https://api.github.com/repos/actions/runner/releases/latest | jq -r '.tag_name' | sed -e 's/^v//') runner_ver="$latest_ver" echo "✅ runner_ver=latest is specified. v$latest_ver is detected as the latest version." + if [[ -z "$latest_ver" || "null" == "$latest_ver" ]]; then + echo "❌ could not retrieve the latest version of a runner" + exit 2 + fi fi echo "✅ Startup script will install GitHub Actions v$runner_ver" if $arm ; then