From 79374f35e48e605b90885c80df5a370a85ba2cbb Mon Sep 17 00:00:00 2001 From: gauravsaini04 <147703805+gauravsaini04@users.noreply.github.com> Date: Wed, 8 May 2024 09:47:57 +0000 Subject: [PATCH] image size check should fail --- .github/actions/smoke-test/check-image-size.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/smoke-test/check-image-size.sh b/.github/actions/smoke-test/check-image-size.sh index e1cad85d2..7a48ff69b 100755 --- a/.github/actions/smoke-test/check-image-size.sh +++ b/.github/actions/smoke-test/check-image-size.sh @@ -1,4 +1,7 @@ #!/bin/bash + +set -e + # Function to handle errors handle_error() { local exit_code=$? @@ -8,7 +11,6 @@ handle_error() { exit $exit_code } trap 'handle_error $LINENO ${BASH_COMMAND%% *}' ERR -echo "This is line $LINENO" convert_gb_to_bytes() { local gb="$1" @@ -52,6 +54,7 @@ check_image_size() { if [ -n $image_size ] && [ $image_size -gt $threshold ]; then echo -e "\nImage size exceeds the threshold of $THRESHOLD_IN_GB gb" echo -e "\n❌ Image size check failed." + exit 1; else echo -e "\n✅ Passed!" fi