ci(autoblacks): add step to check if black reformatted some code

This commit is contained in:
Laurent Peuch 2024-03-07 02:27:53 +01:00 committed by Bram
parent d09e1a2fab
commit 518e5ebb85

View file

@ -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 }}