From e1770ec52bf3363e3436b2e8c26488996f4171c8 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:13:34 +0100 Subject: [PATCH] Only add --tags option if tagging message is set --- entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2685fb5..2118375 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -75,8 +75,15 @@ _tag_commit() { _push_to_github() { if [ -z "$INPUT_BRANCH" ] then - echo "git push origin without branch name" - git push origin + + # Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set + if [ -n "$INPUT_TAGGING_MESSAGE" ] + then + git push origin --tags + else + git push origin + fi + else git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags fi