From f8c9d79a141c6685fc3cd8bc5958cd900dfe9a4b Mon Sep 17 00:00:00 2001 From: Guillaume Falourd Date: Tue, 21 Dec 2021 09:52:13 -0300 Subject: [PATCH] Update action.yml --- action.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 364672e..0cfe07a 100644 --- a/action.yml +++ b/action.yml @@ -83,17 +83,19 @@ runs: git config --local user.email "${{ inputs.email }}" git config --local user.name "${{ inputs.name }}" - git add ${{ inputs.files }} -v - git commit -m "${{ inputs.commit_message }}" $EMPTY - - git branch push-and-commit-action-${{ github.run_id }}-${{ github.job }} - git fetch "${{ inputs.remote_repository }}" "$CURRENT_BRANCH" - git checkout "$CURRENT_BRANCH" - git merge push-and-commit-action-${{ github.run_id }}-${{ github.job }} - git branch -d push-and-commit-action-${{ github.run_id }}-${{ github.job }} - + if [[ `git status --porcelain` ]]; then + git add ${{ inputs.files }} -v + git commit -m "${{ inputs.commit_message }}" $EMPTY + + git branch push-and-commit-action-${{ github.run_id }}-${{ github.job }} + git fetch "${{ inputs.remote_repository }}" "$CURRENT_BRANCH" + git checkout "$CURRENT_BRANCH" + git merge push-and-commit-action-${{ github.run_id }}-${{ github.job }} + git branch -d push-and-commit-action-${{ github.run_id }}-${{ github.job }} + git push "${{ inputs.remote_repository }}" "$CURRENT_BRANCH:$TARGET_BRANCH" --follow-tags $FORCE $TAGS + else echo "No changes" fi