Skip to content

Merge pull request #385 from chinapandaman/PPF-384 #122

Merge pull request #385 from chinapandaman/PPF-384

Merge pull request #385 from chinapandaman/PPF-384 #122

# https://github.com/cclauss/autoblack
name: Code Formatting
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BLACK_ISORT_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- 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