-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.54 KB
/
linters.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Linters
on:
pull_request:
jobs:
commitizen:
uses: janw/workflows/.github/workflows/commitizen.yaml@main
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
- name: Install poetry
run: pipx install poetry
- name: Set up python environment
uses: actions/setup-python@v5
with:
cache: poetry
python-version: 3.x
- name: Install dependencies
run: poetry install --sync
- id: cache-restore
uses: actions/cache/restore@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-v0|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
- uses: stefanzweifel/git-auto-commit-action@v5
if: >
always()
&& !startsWith(github.event.head_commit.message, 'build(autofix):')
with:
commit_message: "build(autofix): Auto-fix linting issues"
commit_user_name: "Jan Willhaus [bot]"
commit_user_email: "[email protected]"
commit_author: Jan Willhaus [bot] <[email protected]>
- id: cache-save
uses: actions/cache/save@v4
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ~/.cache/pre-commit