Skip to content

Commit 8f339ba

Browse files
authored
workflow: add auto format job with black on pull request (#62)
* Autoformat with black * Fix * Update and rename black.yml to black_PR.yml * Update black_PR.yml
1 parent 71bf6a4 commit 8f339ba

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/black_PR.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pull format
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
pull_format:
7+
permissions:
8+
actions: write
9+
checks: write
10+
contents: write
11+
runs-on: ubuntu-latest
12+
continue-on-error: true
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install black
20+
run: pip install black
21+
- name: run black
22+
# run: black $(git ls-files '*.py')
23+
run: black .
24+
- name: AutoCommit
25+
uses: stefanzweifel/git-auto-commit-action@v4
26+
with:
27+
commit_message: Apply Code Formatter Change

0 commit comments

Comments
 (0)