-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (31 loc) · 933 Bytes
/
pre-commit.yaml
File metadata and controls
32 lines (31 loc) · 933 Bytes
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
name: Run pull-request syntax workflows
on:
- pull_request
jobs:
pre_commit:
runs-on: self-hosted
strategy:
matrix:
python-version:
- "3.12"
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: Fetch all branches and tags
run: git fetch --prune --unshallow
- name: Determine changed files
id: changed-files
run: |
CHANGED_FILES=$(git diff --name-only HEAD^ | xargs)
echo "Changed files: $CHANGED_FILES"
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
- name: Run Check
uses: pre-commit/action@v3.0.1
with:
extra_args: >-
--files ${{ env.CHANGED_FILES }}
--hook-stage manual