-
Notifications
You must be signed in to change notification settings - Fork 6
28 lines (26 loc) · 940 Bytes
/
black.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Black
run: pip install black
- name: Install Black Jupyter
run: pip install jupyter-black
- name: Run black --check bancor_research/bancor_simulator
run: black --check bancor_research/bancor_simulator
- name: If needed, commit black changes to the pull request
if: failure()
run: |
black bancor_research/bancor_simulator
git config --global user.name 'mikewcasale'
git remote set-url origin https://x-access-token:${{ secrets.GIT_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "fixup: Format Python code with Black"
git push