File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 with :
2525 python-version : ' 3.13'
2626
27- - uses : pre-commit/action@v3.0.1
27+ - name : install pre-commit
28+ run : python3 -m pip install pre-commit
29+
30+ - name : Checkout code
31+ uses : actions/checkout@v5
32+ with :
33+ fetch-depth : 0
34+
35+ - name : Get changed files
36+ id : changed-files
37+ run : |
38+ CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr '\n' ' ')
39+ echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV
40+
41+ - name : Print changed files
42+ run : |
43+ echo "Changed files: $CHANGED_FILES"
44+
45+ - name : Run pre-commit on changed files
46+ run : |
47+ if [ -n "$CHANGED_FILES" ]; then
48+ pre-commit run --color always --files $CHANGED_FILES --show-diff-on-failure
49+ else
50+ echo "No changed files to check."
51+ fi
2852
2953 pytest :
3054 needs : code-quality
You can’t perform that action at this time.
0 commit comments