diff --git a/scripts/failure.sh b/scripts/failure.sh index b4683d5..83263c5 100755 --- a/scripts/failure.sh +++ b/scripts/failure.sh @@ -3,8 +3,14 @@ set -e echo "This script will fail" -images=("alpine" "gibtsnicht:1.23.34") +images=("alpine" "ubuntu") for image in "${images[@]}"; do - error=$(docker pull "$image" 2>&1) || echo -e "Failed to pull image: $image\n\nDetailed error message:\n$error" >> "$GITHUB_STEP_SUMMARY"; exit 1 + echo "Pull $image" + error=$(docker pull "$image" 2>&1) || #echo -e "Failed to pull image: $image\n\nDetailed error message:\n$error" >>"$GITHUB_STEP_SUMMARY" + + if [ "${PIPESTATUS[0]}" != "0" ]; then + echo -e "Failed to pull image: $image\n\nDetailed error message:\n$error" >>"$GITHUB_STEP_SUMMARY" + exit 1 + fi done