Skip to content

Commit 691d4fc

Browse files
autocommit added to github acctions
1 parent c84778f commit 691d4fc

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/checks.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11
name: Checks
22
on: [push]
33

4+
permissions:
5+
contents: write
6+
47
jobs:
58
test-lint:
69
runs-on: ubuntu-24.04
10+
711
steps:
812
- uses: actions/checkout@v4
913

14+
- name: Set up Python for formatting
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Auto-format (black + isort)
20+
run: |
21+
pip install --upgrade pip
22+
pip install black isort
23+
isort backend/app
24+
black backend/app
25+
26+
- name: Auto-commit formatted files
27+
uses: stefanzweifel/git-auto-commit-action@v5
28+
with:
29+
commit_message: "ci(fmt): black+isort [skip ci]"
30+
file_pattern: backend/**/*.py
31+
1032
- name: Create backend .env for CI
1133
env:
1234
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
@@ -33,10 +55,6 @@ jobs:
3355
- name: Test
3456
run: docker compose run --rm backend sh -lc "/py/bin/python app/manage.py test -v 2"
3557

36-
- name: Auto-format (Black + isort)
37-
run: docker compose run --rm backend sh -lc "/py/bin/isort app && /py/bin/black app"
38-
39-
4058
- name: Lint
4159
run: docker compose run --rm backend sh -lc "/py/bin/flake8"
4260

0 commit comments

Comments
 (0)