From 35b5e8e67078a18b9bd2926ad3869ad9b1f3b8a8 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 4 Apr 2024 12:36:52 +0200 Subject: [PATCH] fail on wrong branch --- ci/packer.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci/packer.sh b/ci/packer.sh index 3d2be0227..525fa2f09 100644 --- a/ci/packer.sh +++ b/ci/packer.sh @@ -98,6 +98,13 @@ cd raspiblitz # checkout the desired branch git checkout $BRANCH +if [ $? -gt 0 ]; then + cd .. + rm -rf raspiblitz 2>/dev/null + echo "# BRANCH: ${BRANCH}" + echo "error='git checkout BRANCH failed'" + exit 1 +fi # check commit hash if set if [ ${#COMMITHASH} -gt 0 ]; then