jq returns "null" if the field does not exist (#478)

This commit is contained in:
Quan TRAN
2020-05-14 17:09:20 +02:00
committed by GitHub
parent cd8e4ddba1
commit 73307c0a30

View File

@@ -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