From da55e4a0cfa97050aa19909147f5fbb20c15ec16 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:09:53 +0100 Subject: [PATCH 1/6] Add echo statements for easier debugging --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 8372817..4b30af9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -67,12 +67,15 @@ _tag_commit() { if [ -n "$INPUT_TAGGING_MESSAGE" ] then git tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE" + else + echo " No tagging message supplied. Not tag will be added" fi } _push_to_github() { if [ -z "$INPUT_BRANCH" ] then + echo "git push origin without branch name" git push origin --tags else git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags From 0453bb1c25c98af93b177569dd94c026ba70297c Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:11:13 +0100 Subject: [PATCH 2/6] Temp disable push of tags --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4b30af9..2685fb5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -76,7 +76,7 @@ _push_to_github() { if [ -z "$INPUT_BRANCH" ] then echo "git push origin without branch name" - git push origin --tags + git push origin else git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags fi From e1770ec52bf3363e3436b2e8c26488996f4171c8 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:13:34 +0100 Subject: [PATCH 3/6] 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 From 2b6b90e8f19aab760cf0dd11b38caad38562f165 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:20:32 +0100 Subject: [PATCH 4/6] Test shorthand --- entrypoint.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2118375..af80ade 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -75,14 +75,15 @@ _tag_commit() { _push_to_github() { if [ -z "$INPUT_BRANCH" ] then + git push origin --all --tags # 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 + # 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 From f73d11d461aa643d5a65939f57189173d90c7c20 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:21:42 +0100 Subject: [PATCH 5/6] Revert changes --- entrypoint.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index af80ade..b4a63d6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -75,15 +75,13 @@ _tag_commit() { _push_to_github() { if [ -z "$INPUT_BRANCH" ] then - git push origin --all --tags - - # 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 + # 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 From 026f88c27cf2174838d6c83043028b47428cd069 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 14 Mar 2020 13:32:10 +0100 Subject: [PATCH 6/6] Fix typo in message --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b4a63d6..5acd9f8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -68,7 +68,7 @@ _tag_commit() { then git tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE" else - echo " No tagging message supplied. Not tag will be added" + echo " No tagging message supplied. No tag will be added." fi }