diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml index de552880..369f8882 100644 --- a/.github/workflows/autoblack.yml +++ b/.github/workflows/autoblack.yml @@ -15,8 +15,15 @@ jobs: with: options: "." continue-on-error: true + - shell: pwsh + id: check_files_changed + run: | + # Diff HEAD with the previous commit + $diff = git diff + $HasDiff = $diff.Length -gt 0 + Write-Host "::set-output name=files_changed::$HasDiff" - name: Create Pull Request - if: steps.black.outputs.is_formatted == 'true' + if: steps.check_files_changed.outputs.files_changed == 'true' uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }}