From d53ba3b49f796ae458b7bdcd5eca0bddafc5d463 Mon Sep 17 00:00:00 2001 From: GuillaumeFalourd Date: Thu, 6 Jan 2022 22:24:08 -0300 Subject: [PATCH] update git push to remote action Signed-off-by: GuillaumeFalourd --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index d38f9fe..c858e21 100644 --- a/action.yml +++ b/action.yml @@ -138,6 +138,10 @@ runs: REMOTE_URL=https://$DESTINATION_OWNER:${{ inputs.access_token }}@github.com/$DESTINATION_OWNER/$DESTINATION_REPOSITORY git remote set-url origin $REMOTE_URL git fetch origin + git ls-remote --heads origin ${{ inputs.target_branch }} | wc -l + if [ "$?" != "1" ]; then + git checkout -b ${{ inputs.target_branch }} + fi git checkout ${{ inputs.target_branch }} git add . git status