From 99b0d49f5cc5822e1c49df4793a61487bb349ef0 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 16 Apr 2022 13:16:39 +0530 Subject: [PATCH] fix: check if deployment branch exists on remote; woodpecker only clones trigger branch --- scripts/zola.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/zola.sh b/scripts/zola.sh index c116d4f..1d10272 100755 --- a/scripts/zola.sh +++ b/scripts/zola.sh @@ -98,12 +98,12 @@ deploy() { tmp_dir=$(mktemp -d) cp -r $2/* $tmp_dir - if [[ -z $(git branch --list $1) ]] + if [[ -z $(git ls-remote --heads origin ${1}) ]] then - "[*] Creating deployment branch $1" + echo "[*] Creating deployment branch $1" git checkout --orphan $1 else - "[*] Deployment branch $1 exists, pulling changes from remote" + echo "[*] Deployment branch $1 exists, pulling changes from remote" git pull origin $1 --force git checkout $1 fi