|
1 | | -# GitHub Action that uses Black to reformat the Python code in an incoming pull request. |
2 | | -# If all Python code in the pull request is compliant with Black then this Action does nothing. |
3 | | -# Othewrwise, Black is run and its changes are committed back to the incoming pull request. |
4 | | -# https://github.com/cclauss/autoblack |
| 1 | +# GitHub Action that uses Black to reformat the Python code in an |
| 2 | +# incoming pull request. If all Python code in the pull request is |
| 3 | +# compliant with Black then this Action does nothing. Othewrwise, |
| 4 | +# Black is run and its changes are committed back to the incoming pull |
| 5 | +# request. https://github.com/cclauss/autoblack |
5 | 6 |
|
| 7 | +--- |
6 | 8 | name: isort and black check |
7 | 9 | on: [pull_request] |
8 | 10 | jobs: |
9 | 11 | build: |
10 | 12 | runs-on: ubuntu-latest |
11 | 13 | steps: |
12 | | - - uses: actions/checkout@v5 |
| 14 | + - uses: actions/checkout@v6 |
13 | 15 | - name: Set up Python 3.14 |
14 | | - uses: actions/setup-python@v5 |
| 16 | + uses: actions/setup-python@v6 |
15 | 17 | with: |
16 | | - python-version: 3.13 |
| 18 | + python-version: 3.14 |
17 | 19 | - name: Install click, black and isort |
18 | | - run: pip install 'click==8.0.4' 'black==25.1.0' 'isort==5.13.2' |
| 20 | + run: pip install 'click==8.2.1' 'black==25.11.0' 'isort==8.0.1' |
19 | 21 | - name: Run isort --check . |
20 | 22 | run: isort --check . |
21 | | - - name: Run black --check . |
22 | | - run: black --check . |
23 | | - # - name: If needed, commit black changes to the pull request |
24 | | - # if: failure() |
25 | | - # run: | |
26 | | - # black . |
27 | | - # git config --global user.name 'autoblack' |
28 | | - # git config --global user.email 'rocky@users.noreply.github.com' |
29 | | - # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY |
30 | | - # git checkout $GITHUB_HEAD_REF |
31 | | - # git commit -am "fixup: Format Python code with Black" |
32 | | - # git push |
| 23 | + - name: Run black --check --diff . |
| 24 | + run: black --check --diff . |
| 25 | + # - name: If needed, commit black changes to the pull request |
| 26 | + # if: failure() |
| 27 | + # run: | |
| 28 | + # black . |
| 29 | + # git config --global user.name 'autoblack' |
| 30 | + # git config --global user.email 'rocky@users.noreply.github.com' |
| 31 | + # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY |
| 32 | + # git checkout $GITHUB_HEAD_REF |
| 33 | + # git commit -am "fixup: Format Python code with Black" |
| 34 | + # git push |
0 commit comments