File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -244,14 +244,14 @@ if [ -n "$INPUT_PREPARE_TASK_CONTAINER_IMAGE_CHANGES" ] && [ -n "$INPUT_PREPARE_
244244 waitOnTask " $TASK_ARN "
245245
246246 TASK_RESPONSE=$( describeTask " $TASK_ARN " )
247- EXIT_CODE=$( echo " $TASK_RESPONSE " | jq -r ' .tasks[0]?.containers[0]?.exitCode // 255' )
247+ if echo " $TASK_RESPONSE " | jq -e ' .tasks[0].containers[] | select((.exitCode // 255) != 0)' > /dev/null; then
248+ EXIT_CODE=$( echo " $TASK_RESPONSE " | jq -r ' .tasks[0].containers[] | select((.exitCode // 255) != 0) | .exitCode // 255' )
248249
249- if [ " $EXIT_CODE " -eq 0 ]; then
250- echo -e " ${GREEN} Task has executed successfully." ;
251- else
252250 echo -e " ${RED} Task returned non-zero exit code: ${RESET_TEXT} $EXIT_CODE . Raw response is below:" ;
253251 echo -e " ${TASK_RESPONSE} "
254252 exit 1;
253+ else
254+ echo -e " ${GREEN} Task has executed successfully." ;
255255 fi
256256fi
257257
You can’t perform that action at this time.
0 commit comments