update temporary branch syntax

Signed-off-by: GuillaumeFalourd <guillaume.falourd@zup.com.br>
This commit is contained in:
GuillaumeFalourd 2022-01-07 11:08:35 -03:00
parent 3bc2c10728
commit 3c6756b06b

View file

@ -88,11 +88,11 @@ runs:
if [[ `git status --porcelain` ]]; then if [[ `git status --porcelain` ]]; then
git add ${{ inputs.files }} -v git add ${{ inputs.files }} -v
git commit -m "${{ inputs.commit_message }}" $EMPTY git commit -m "${{ inputs.commit_message }}" $EMPTY
git branch push-and-commit-action-${{ github.run_id }}-${{ github.job }} git branch git-commit-push-action-${{ github.run_id }}-${{ github.job }}
git fetch "${{ inputs.remote_repository }}" "$CURRENT_BRANCH" git fetch "${{ inputs.remote_repository }}" "$CURRENT_BRANCH"
git checkout "$CURRENT_BRANCH" git checkout "$CURRENT_BRANCH"
git merge push-and-commit-action-${{ github.run_id }}-${{ github.job }} git merge git-commit-push-action-${{ github.run_id }}-${{ github.job }}
git branch -d push-and-commit-action-${{ github.run_id }}-${{ github.job }} git branch -d git-commit-push-action-${{ github.run_id }}-${{ github.job }}
git push "${{ inputs.remote_repository }}" "$CURRENT_BRANCH:$TARGET_BRANCH" --follow-tags $FORCE $TAGS git push "${{ inputs.remote_repository }}" "$CURRENT_BRANCH:$TARGET_BRANCH" --follow-tags $FORCE $TAGS
else else
@ -148,7 +148,7 @@ runs:
# Won't commit if no changes were made # Won't commit if no changes were made
git diff-index --quiet HEAD || git commit --message "${{ inputs.commit_message }}" git diff-index --quiet HEAD || git commit --message "${{ inputs.commit_message }}"
git status git status
git branch copy-push-files-action-${{ github.run_id }}-${{ github.job }} git branch git-commit-push-action-${{ github.run_id }}-${{ github.job }}
# Create new branch (if necessary) # Create new branch (if necessary)
BE=$(git ls-remote --heads origin ${{ inputs.target_branch }} | wc -l) BE=$(git ls-remote --heads origin ${{ inputs.target_branch }} | wc -l)
@ -158,8 +158,8 @@ runs:
else else
git checkout ${{ inputs.target_branch }} git checkout ${{ inputs.target_branch }}
fi fi
git merge -X theirs copy-push-files-action-${{ github.run_id }}-${{ github.job }} git merge -X theirs git-commit-push-action-${{ github.run_id }}-${{ github.job }}
git branch -d copy-push-files-action-${{ github.run_id }}-${{ github.job }} git branch -d git-commit-push-action-${{ github.run_id }}-${{ github.job }}
echo echo
echo "##### Pushing git commit #####" echo "##### Pushing git commit #####"