From 52cff06fbe4be05e5043d07495f5eea29f1224cd Mon Sep 17 00:00:00 2001 From: Carsten Lenz Date: Wed, 23 Oct 2024 14:57:32 +0200 Subject: [PATCH] chore: add exit --- scripts/failure.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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