-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (27 loc) · 866 Bytes
/
python-format.yml
File metadata and controls
33 lines (27 loc) · 866 Bytes
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
29
30
31
32
33
name: Run Black Formatter
on: [push, pull_request]
jobs:
black-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
- name: Run Black formatter
run: black .
- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: format code using Black"
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
push_options: --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}