From 092526315c84d2807f5b2d0513d21e3bed0145da Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 5 Jul 2020 22:02:01 +0200 Subject: [PATCH] git_auto_update: Added check for if no release tag can't be found --- roles/git_auto_update/templates/update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/git_auto_update/templates/update.sh b/roles/git_auto_update/templates/update.sh index 5140969..5019ad5 100644 --- a/roles/git_auto_update/templates/update.sh +++ b/roles/git_auto_update/templates/update.sh @@ -25,7 +25,11 @@ git remote set-url origin "$REPO"; git fetch --recurse-submodules --tags > /dev/null; TAG=$(git tag --list | grep "^$PREFIX" | sort -r | head -n 1); -if [ -z "$GPG_FINGERPRINT" ] || (git verify-tag --raw "$TAG" 2>&1 | grep --fixed-strings " VALIDSIG $GPG_FINGERPRINT ") > /dev/null; then + +if [ -z "$TAG" ]; then + error "No release tag found"; + exit 1; +elif [ -z "$GPG_FINGERPRINT" ] || (git verify-tag --raw "$TAG" 2>&1 | grep --fixed-strings " VALIDSIG $GPG_FINGERPRINT ") > /dev/null; then git reset --quiet --hard --recurse-submodules; git checkout --quiet --recurse-submodules "$TAG"; chown --recursive "$DEST_USER:$DEST_GROUP" .;