File tree Expand file tree Collapse file tree 1 file changed +31
-4
lines changed
Expand file tree Collapse file tree 1 file changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,39 @@ name: pre-commit
33on :
44 pull_request :
55 push :
6- branches : [master]
6+ branches : [master, main ]
77
88jobs :
99 pre-commit :
1010 runs-on : ubuntu-latest
11+ timeout-minutes : 15
1112 steps :
12- - uses : actions/checkout@v2
13- - uses : actions/setup-python@v2
14- - uses : pre-commit/action@v2.0.3
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v4
18+ with :
19+ python-version : ' 3.11'
20+
21+ - name : Cache pre-commit environments
22+ uses : actions/cache@v3
23+ with :
24+ path : ~/.cache/pre-commit
25+ key : pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
26+ restore-keys : |
27+ pre-commit-${{ runner.os }}-
28+ continue-on-error : true
29+
30+ - name : Install pre-commit (fallback)
31+ if : failure()
32+ run : |
33+ python -m pip install --upgrade pip
34+ pip install pre-commit
35+
36+ - name : Run pre-commit
37+ uses : pre-commit/action@v3.0.0
38+ continue-on-error : false
39+ env :
40+ # Reduce memory usage for pre-commit
41+ PRE_COMMIT_COLOR : never
You can’t perform that action at this time.
0 commit comments