From b0b5ed34dd1ea9619e9e3577becb4f5a8c5bac51 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 16 May 2020 11:42:40 +0200 Subject: [PATCH] Update entrypoint to handle push_options --- entrypoint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f6c522c..aeab256 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -73,21 +73,27 @@ _tag_commit() { } _push_to_github() { + + echo "INPUT_PUSH_OPTIONS: ${INPUT_PUSH_OPTIONS}"; + echo "::debug::Apply push options ${INPUT_PUSH_OPTIONS}"; + + INPUT_PUSH_OPTIONS_ARRAY=( $INPUT_PUSH_OPTIONS ); + if [ -z "$INPUT_BRANCH" ] then # Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set if [ -n "$INPUT_TAGGING_MESSAGE" ] then echo "::debug::git push origin --tags"; - git push origin --tags; + git push origin --tags ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"}; else echo "::debug::git push origin"; - git push origin; + git push origin ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"}; fi else echo "::debug::Push commit to remote branch $INPUT_BRANCH"; - git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags; + git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"}; fi }