Merge pull request #756 from chinapandaman/PPF-755 #298
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/cclauss/autoblack | |
name: Code Formatting | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.BLACK_ISORT_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install black/isort | |
run: pip install black isort | |
- name: If needed, commit black/isort changes to the pull request | |
run: | | |
black . | |
isort . | |
git config --global user.name 'black-isort-bot' | |
git config --global user.email 'bot@domain.com' | |
git diff --quiet && git diff --staged --quiet || git commit -am '[skip ci]: black/isort' | |
git push |