Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,27 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Get changed Python files
id: changed-py-files
uses: tj-actions/changed-files@v47
with:
files: |
**.py

- name: Set up Python
uses: actions/setup-python@v2
if: steps.changed-py-files.outputs.any_changed == 'true'
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install Black
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
python -m pip install --upgrade pip
pip install black

- name: Check Black Formatting
run: black --check .
if: steps.changed-py-files.outputs.any_changed == 'true'
run: black --check ${{ steps.changed-py-files.outputs.all_changed_files }}
Loading