-
Notifications
You must be signed in to change notification settings - Fork 32
36 lines (36 loc) · 1.16 KB
/
pre-commit.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
name: Run pull-request syntax workflows
on:
- pull_request
jobs:
pre_commit:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: Run Check
uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
- name: Checks failed, notification
if: failure()
run: |
echo "Tests Failed"
echo "Run the following command to identify issues"
echo "pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }}"
- name: Upload log artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: pre-commit-py${{ matrix.python-version }}
path: /home/runner/.cache/pre-commit/pre-commit.log