Skip to content

Commit

Permalink
ci(autoblacks): add step to check if black reformatted some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Mar 7, 2024
1 parent d09e1a2 commit 518e5eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/autoblack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 518e5eb

Please sign in to comment.