remove config copy in autoformat #664
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
name: "Autoformat using Black" | |
on: [workflow_dispatch, push] | |
jobs: | |
autoformat: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install pip modules | |
run: pip install black isort | |
- name: Run isort | |
run: isort . | |
- name: Run Black | |
run: black . | |
- name: Commit and push changes | |
run: | | |
git config user.name github-actions | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -m "auto: format python code" | |
git push |