Skip to content

Commit

Permalink
chore: add exit
Browse files Browse the repository at this point in the history
  • Loading branch information
carslen committed Oct 23, 2024
1 parent 89823fc commit 52cff06
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 52cff06

Please sign in to comment.