diff --git a/scripts/validate-param.sh b/scripts/validate-param.sh index 915809f..7fc6ab1 100755 --- a/scripts/validate-param.sh +++ b/scripts/validate-param.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e # Exit immediately if a command exits with a non-zero status. + # Extract inputs PARAMS=$PARAMS WORKFLOW_FILE=$WORKFLOW_FILE @@ -35,6 +37,11 @@ echo "${PARAMS}" | jq -c 'to_entries | .[]' | while read -r step; do ACTUAL_VALUE=$(echo "${STEP_CONTENT}" | yq e ".${PARAM}" -) + if [ "${ACTUAL_VALUE}" == "null" ]; then + echo "The parameter ${PARAM} for step ${STEP_ID} is not set." + exit 1 + fi + if [ "${ACTUAL_VALUE}" != "${EXPECTED_VALUE}" ]; then echo "The parameter ${PARAM} for step ${STEP_ID} is not set to ${EXPECTED_VALUE}. Current value: ${ACTUAL_VALUE}" exit 1