-
Notifications
You must be signed in to change notification settings - Fork 1.9k
45 lines (37 loc) · 1.04 KB
/
pre-commit.yml
File metadata and controls
45 lines (37 loc) · 1.04 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
45
name: pre-commit
on:
pull_request:
branches:
- master
- trt10
push:
branches:
- master
- trt10
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
# grab the history of the PR
fetch-depth: 0
- name: Fetch commits
run: |
git fetch origin ${{ github.event.before }} || true
git fetch origin ${{ github.sha }}
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.1
if: github.event_name == 'push'
with:
extra_args: >
--from-ref ${{ github.event.before }}
--to-ref ${{ github.sha }}
--show-diff-on-failure --color=always
- uses: pre-commit/action@v3.0.1
if: github.event_name == 'pull_request'
with:
extra_args: >
--from-ref ${{ github.event.pull_request.base.sha }}
--to-ref ${{ github.event.pull_request.head.sha }}
--show-diff-on-failure --color=always