We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61cbfbd commit 73d0458Copy full SHA for 73d0458
.github/workflows/pre-commit.yml
@@ -26,7 +26,17 @@ jobs:
26
run: pip install codespell
27
28
- name: Run pre-commit checks
29
- run: pre-commit run --all-files
+ run: |
30
+ BASE_SHA=${{ github.event.pull_request.base.sha }}
31
+ HEAD_SHA=${{ github.event.pull_request.head.sha }}
32
+ CHANGED_FILES=$(git diff --name-only $BASE_SHA $HEAD_SHA | grep -E '\.(py|c|h|md|rst|yml)$' || true)
33
+ echo "Changed files:"
34
+ echo "$CHANGED_FILES" | tr ' ' '\n'
35
+ if [ -n "$CHANGED_FILES" ]; then
36
+ pre-commit run --files $CHANGED_FILES -v
37
+ else
38
+ echo "No matching files changed."
39
+ fi
40
41
- name: Validate commit messages
42
run: |
0 commit comments