From 519e8a4a3135b8e7bf9ce527b0887d6b9b73cf6e Mon Sep 17 00:00:00 2001 From: NI Date: Mon, 28 Dec 2020 23:49:04 +0800 Subject: [PATCH] Fix the `.ci.sh` so it generates release notes corrently --- .ci.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.ci.sh b/.ci.sh index 136b57c..c089679 100644 --- a/.ci.sh +++ b/.ci.sh @@ -82,9 +82,17 @@ if [ "$SSHWIFTY_DEPLOY" = 'yes' ]; then echo 'Fetching extra references from the repository ...' - catch retry git fetch --tags --depth 1 + GIT_TAG_FETCH_PARAM= - SSHWIFTY_LAST_TAG_NAME=$(git describe --tags --abbrev=0 HEAD~1) + if [ "$(git rev-parse --is-shallow-repository)" ]; then + echo 'Shallow clone detected, will unshallow ...' + + GIT_TAG_FETCH_PARAM='--unshallow' + fi + + catch retry git fetch --tags "$GIT_TAG_FETCH_PARAM" + + SSHWIFTY_LAST_TAG_NAME=$(git describe --tags --abbrev=0 --always HEAD~1) fi echo "Version: $SSHWIFTY_VERSION"