update git push to remote action
Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>
This commit is contained in:
parent
d53ba3b49f
commit
865a51b580
1 changed files with 5 additions and 3 deletions
|
@ -138,11 +138,13 @@ runs:
|
||||||
REMOTE_URL=https://$DESTINATION_OWNER:${{ inputs.access_token }}@github.com/$DESTINATION_OWNER/$DESTINATION_REPOSITORY
|
REMOTE_URL=https://$DESTINATION_OWNER:${{ inputs.access_token }}@github.com/$DESTINATION_OWNER/$DESTINATION_REPOSITORY
|
||||||
git remote set-url origin $REMOTE_URL
|
git remote set-url origin $REMOTE_URL
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git ls-remote --heads origin ${{ inputs.target_branch }} | wc -l
|
BE=$(git ls-remote --heads origin ${{ inputs.target_branch }} | wc -l)
|
||||||
if [ "$?" != "1" ]; then
|
if [[ $BE == *"0"* ]]; then
|
||||||
|
echo "##### Target branch doesn't exist. Creating new branch #####"
|
||||||
git checkout -b ${{ inputs.target_branch }}
|
git checkout -b ${{ inputs.target_branch }}
|
||||||
fi
|
else
|
||||||
git checkout ${{ inputs.target_branch }}
|
git checkout ${{ inputs.target_branch }}
|
||||||
|
fi
|
||||||
git add .
|
git add .
|
||||||
git status
|
git status
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue