mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2024-11-06 02:08:05 +00:00
Update entrypoint to handle push_options
This commit is contained in:
parent
ae38c94802
commit
b0b5ed34dd
@ -73,21 +73,27 @@ _tag_commit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_push_to_github() {
|
_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" ]
|
if [ -z "$INPUT_BRANCH" ]
|
||||||
then
|
then
|
||||||
# Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set
|
# Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set
|
||||||
if [ -n "$INPUT_TAGGING_MESSAGE" ]
|
if [ -n "$INPUT_TAGGING_MESSAGE" ]
|
||||||
then
|
then
|
||||||
echo "::debug::git push origin --tags";
|
echo "::debug::git push origin --tags";
|
||||||
git push origin --tags;
|
git push origin --tags ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
|
||||||
else
|
else
|
||||||
echo "::debug::git push origin";
|
echo "::debug::git push origin";
|
||||||
git push origin;
|
git push origin ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "::debug::Push commit to remote branch $INPUT_BRANCH";
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user