update git push to remote action

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>
This commit is contained in:
GuillaumeFalourd 2022-01-06 22:13:47 -03:00
parent 49269c1e82
commit 4f78503c4b

View file

@ -55,7 +55,6 @@ runs:
- name: Git push and commit origin
if: ${{ inputs.remote_repository == 'origin' }}
run: |
echo "##### Git Push and Commit ORIGIN #####"
CURRENT_BRANCH=${GITHUB_REF}
case $CURRENT_BRANCH in "refs/heads/"*)
CURRENT_BRANCH=$(echo "$CURRENT_BRANCH" | sed "s@refs/heads/@@")
@ -104,7 +103,6 @@ runs:
- name: Git push and commit remote
if: ${{ inputs.remote_repository != 'origin' }}
run: |
echo "##### Git Push and Commit REMOTE #####"
if [ -z "${{ inputs.access_token }}" ]; then
echo "WARNING: The access_token input is mandatory to push files to another repository."
exit 1
@ -140,7 +138,7 @@ 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 checkout -b ${{ inputs.target_branch }}
git checkout ${{ inputs.target_branch }}
git add .
git status