-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (35 loc) · 1.24 KB
/
pr_precommit.yml
File metadata and controls
44 lines (35 loc) · 1.24 KB
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
name: PR pre-commit
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- uses: tj-actions/changed-files@v47.0.0
id: changed-files
- name: List changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
- if: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'full pre-commit') }}
name: Full pre-commit
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
- if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'full pre-commit') }}
name: Local pre-commit
uses: pre-commit/action@v3.0.1
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
- if: ${{ failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
uses: pre-commit-ci/lite-action@v1.1.0