Skip to content

Commit a7aa5e8

Browse files
committed
Add pre-commit workflow
1 parent eadde28 commit a7aa5e8

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release-v**'
7+
pull_request:
8+
branches:
9+
- 'release-v**'
10+
11+
jobs:
12+
pre_job:
13+
name: Path match check
14+
runs-on: ubuntu-latest
15+
# Map a step output to a job output
16+
outputs:
17+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
18+
steps:
19+
- id: skip_check
20+
uses: fkirc/skip-duplicate-actions@master
21+
with:
22+
github_token: ${{ github.token }}
23+
paths_ignore: '["**.po", "**.json"]'
24+
25+
linting:
26+
name: All file linting
27+
needs: pre_job
28+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v6.0.2
32+
- uses: astral-sh/setup-uv@v8.2.0
33+
with:
34+
enable-cache: true
35+
cache-python: true
36+
- name: Install and verify lock
37+
run: uv sync --group dev --locked
38+
- name: Run prek hooks
39+
run: uv run prek run --all-files --show-diff-on-failure

0 commit comments

Comments
 (0)