From 4339e4ea933b82c96b22caf27a67611afb351039 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:43:17 +1300 Subject: [PATCH] FIX Use brackets for if statement (#88) --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e58c620..29972e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -851,7 +851,9 @@ jobs: BRANCH_MAJOR=${BASH_REMATCH[0]} echo "Checking for supported modules in CMS $CMS_MAJOR against branch major $BRANCH_MAJOR" curl -s -o __modules.json https://raw.githubusercontent.com/silverstripe/supported-modules/$CMS_MAJOR/modules.json - if ! jq -e '.' __modules.json >/dev/null 2>&1; then + # If we can't parse the JSON at all, $MODULES will be an empty string and that means we couldn't fetch the file. + MODULES=$(jq -e '.' __modules.json) || true + if [[ $MODULES == "" ]]; then # If there is some error getting the file (e.g. 404 if $CMS_MAJOR is some value we don't have a file for), # the error will be in the __modules.json file - importantly, not in JSON format. echo "Cannot parse supported-modules JSON. Aborting. The content we tried to parse was:"