diff --git a/.github/workflows/java-autoformat.yml b/.github/workflows/java-autoformat.yml index 2f43e129f..359387cff 100644 --- a/.github/workflows/java-autoformat.yml +++ b/.github/workflows/java-autoformat.yml @@ -39,8 +39,7 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git checkout -b auto-format-code git add . - git commit -m "Automated Java code formatting changes" - git push origin auto-format-code + git diff --cached --exit-code || git commit -am "Automated Java code formatting changes" && git push - name: Open pull request if: steps.git-check.outputs.modified == 'true'