Skip to content

Commit 4ada076

Browse files
committed
remove deprecated action and use the standards which avoids all-files
1 parent afbbb98 commit 4ada076

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/pre-commit.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ jobs:
88
pre-commit:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
12+
13+
- name: Get changed files
14+
id: changes
15+
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
16+
with:
17+
list-files: json
18+
filters: |
19+
all:
20+
- added|modified: '**/*'
1221
1322
- uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6
1423
with:
@@ -21,4 +30,16 @@ jobs:
2130
cache-dependency-path: uv.lock
2231
install-cmd: uv sync --frozen --active
2332

24-
- uses: pre-commit/[email protected]
33+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
34+
with:
35+
path: ~/.cache/pre-commit
36+
key: cache-epoch-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml', 'uv.lock') }}
37+
38+
- name: Install pre-commit
39+
run: pre-commit install-hooks
40+
41+
- name: Run pre-commit
42+
run: |
43+
jq '.[]' --raw-output <<< '${{steps.changes.outputs.all_files}}' |
44+
# Run pre-commit to lint and format check files that were changed (but not deleted)
45+
xargs pre-commit run --files

0 commit comments

Comments
 (0)