-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (46 loc) · 1.38 KB
/
pre-commit.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
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
55
name: Lint Check (pre-commit)
on: [pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
name: pre-commit
permissions:
contents: read
# checks: write
# issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Cache pre-commit hooks
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v45
# See:
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#using-local-git-directory-
- uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
continue-on-error: true
# - name: Install dependencies
# run: |
# pip install pre-commit
#
# - name: Run pre-commit hooks
# run: |
# pre-commit run --all-files
# continue-on-error: true
- name: suggester / pre-commit
uses: reviewdog/action-suggester@v1
with:
tool_name: pre-commit
fail_on_error: true
level: warning