55 types : [opened, synchronize, reopened]
66
77jobs :
8-
98 detect_changes :
109 runs-on : ubuntu-latest
11-
1210 outputs :
1311 changed : ${{ steps.changed_files.outputs.changed }}
1412
1513 steps :
1614 - name : Checkout full history
17- uses : actions/checkout@v6
15+ uses : actions/checkout@v4
1816 with :
1917 fetch-depth : 0
2018
@@ -32,30 +30,32 @@ jobs:
3230
3331 - name : Show changed files
3432 run : |
35- echo "Changed files: ${{ steps.changed_files.outputs.changed }} "
36-
33+ echo "Changed files:"
34+ echo "${{ steps.changed_files.outputs.changed }}"
3735
3836 precommit :
39- runs-on : ubuntu-latest
4037 needs : detect_changes
41-
38+ runs-on : ubuntu-latest
4239 if : ${{ needs.detect_changes.outputs.changed != '' }}
4340
4441 steps :
4542 - name : Checkout PR branch
46- uses : actions/checkout@v6
43+ uses : actions/checkout@v4
4744 with :
4845 fetch-depth : 0
4946 ref : ${{ github.head_ref }}
5047
5148 - name : Set up Python
52- uses : actions/setup-python@v6
49+ uses : actions/setup-python@v5
5350 with :
5451 python-version : " 3.12"
5552
5653 - name : Install pre-commit
5754 run : pip install pre-commit
5855
59- - name : Run pre-commit (CI stage, check-only)
56+ - name : Run pre-commit (CI check-only stage) on changed files
57+ env :
58+ CHANGED_FILES : ${{ needs.detect_changes.outputs.changed }}
6059 run : |
61- pre-commit run --hook-stage manual --files ${{ needs.detect_changes.outputs.changed }} --show-diff-on-failure
60+ mapfile -t files <<< "$CHANGED_FILES"
61+ pre-commit run --hook-stage manual --files "${files[@]}" --show-diff-on-failure
0 commit comments