mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2024-12-06 02:09:04 +00:00
Merge pull request #54 from stefanzweifel/hotfix/optional-branch-push
Fix: Push branch to repository if no branch name is given and no tagging message is set
This commit is contained in:
commit
7659782c71
@ -67,13 +67,22 @@ _tag_commit() {
|
||||
if [ -n "$INPUT_TAGGING_MESSAGE" ]
|
||||
then
|
||||
git tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE"
|
||||
else
|
||||
echo " No tagging message supplied. No tag will be added."
|
||||
fi
|
||||
}
|
||||
|
||||
_push_to_github() {
|
||||
if [ -z "$INPUT_BRANCH" ]
|
||||
then
|
||||
git push origin --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
|
||||
|
||||
else
|
||||
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --tags
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user