From bdc88aff2c41c95898038f8f6e59f0884b3c23ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6m=C3=B6ri=20Zsolt?= Date: Fri, 1 Nov 2019 10:44:09 +0100 Subject: [PATCH] Re-add is_defined() to eliminate empty string in git commit --- entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a788fa1..5756e36 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,10 @@ EOF git config --global user.name "GitHub Actions" } +is_defined() { + [ ! -z "${1}" ] +} + # This section only runs if there have been file changes echo "Checking for uncommitted changes in the git working tree." if ! git diff --quiet @@ -41,7 +45,7 @@ then echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}" - git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" "${INPUT_COMMIT_OPTIONS}" + git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" is_defined "${INPUT_COMMIT_OPTIONS}" && "${INPUT_COMMIT_OPTIONS}" git push --set-upstream origin "HEAD:$INPUT_BRANCH" else