diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index a4f7fc195..ad4d0f3e0 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -27,19 +27,17 @@ jobs: run: | ruff check . --fix --exit-zero git add -u - if git diff-index --quiet HEAD --; then - echo "No changes to commit." - exit 1 - else - git status - fi + git status - name: Commit and push changes - if: success() run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git commit -m "Auto-format code using ruff" - git push origin ${{ github.ref }} + if git diff-index --quiet HEAD --; then + echo "No changes to commit." + else + git commit -m "Auto-format code using ruff" + git push origin ${{ github.ref }} + fi env: - GITHUB_TOKEN: ${{ secrets.GX_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GX_TOKEN }} \ No newline at end of file