Skip to content

Commit b53dd11

Browse files
committed
Add PR action to validate pre-commit rules
1 parent f312984 commit b53dd11

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pr.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'release/**'
8+
9+
jobs:
10+
run-pre-commit:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # notwendig für pre-commit diff-basierte Checks
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
23+
24+
- name: Install pre-commit
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install pre-commit
28+
29+
- name: Run pre-commit on PR diff
30+
run: |
31+
pre-commit run --from-ref origin/${{ github.base_ref }} --to-ref ${{ github.sha }}

0 commit comments

Comments
 (0)