From 73307c0a307c7bc3d108063185bd688ede093f70 Mon Sep 17 00:00:00 2001 From: Quan TRAN Date: Thu, 14 May 2020 17:09:20 +0200 Subject: [PATCH] jq returns "null" if the field does not exist (#478) --- scripts/create-latest-svc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create-latest-svc.sh b/scripts/create-latest-svc.sh index 031e3cb49..de04ee12c 100755 --- a/scripts/create-latest-svc.sh +++ b/scripts/create-latest-svc.sh @@ -81,7 +81,7 @@ fi export RUNNER_TOKEN=$(curl -s -X POST ${base_api_url}/${orgs_or_repos}/${runner_scope}/actions/runners/registration-token -H "accept: application/vnd.github.everest-preview+json" -H "authorization: token ${RUNNER_CFG_PAT}" | jq -r '.token') -if [ -z "$RUNNER_TOKEN" ]; then fatal "Failed to get a token"; fi +if [ "null" == "$RUNNER_TOKEN" -o -z "$RUNNER_TOKEN" ]; then fatal "Failed to get a token"; fi #--------------------------------------- # Download latest released and extract