3232 - uses : actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
3333 id : pre-commit-cache
3434 with :
35- path : ~/.cache/pre-commit
35+ path : ~/.cache/prek
3636 key : ${{ runner.os }}-pre-commit-${{ steps.get-date.outputs.cache_tag }}-${{ hashFiles('.pre-commit-config.yaml') }}
3737 restore-keys : |
3838 ${{ runner.os }}-pre-commit-${{ steps.get-date.outputs.cache_tag }}
@@ -53,16 +53,14 @@ jobs:
5353 echo "method=requirements" >> "$GITHUB_OUTPUT"
5454 elif test -f pyproject.toml && grep -q dependency-groups pyproject.toml ; then
5555 echo "method=pep735" >> "$GITHUB_OUTPUT"
56- elif test -f pyproject.toml && grep -q dependency-groups pyproject.toml ; then
57- echo "method=pyproject" >> "$GITHUB_OUTPUT"
5856 else
5957 echo "method=uvx" >> "$GITHUB_OUTPUT"
6058 fi
6159 - name : pre-commit (PEP 735)
6260 if : steps.detect.outputs.method == 'pep735'
6361 run : |
64- uv run --only-group pre-commit pre-commit run --all --show-diff-on-failure
65- uv run --only-group pre-commit pre-commit gc
62+ uv run --only-group pre-commit prek run --all --show-diff-on-failure
63+ uv run --only-group pre-commit prek cache gc
6664 env :
6765 RUFF_OUTPUT_FORMAT : github
6866 REUSE_OUTPUT_FORMAT : github
@@ -76,15 +74,10 @@ jobs:
7674 RUFF_OUTPUT_FORMAT : github
7775 REUSE_OUTPUT_FORMAT : github
7876 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79- - name : Install dependencies
77+ - name : pre-commit (requirements)
8078 if : steps.detect.outputs.method == 'requirements'
81- run : uv pip install --system -r requirements-lint.txt
82- - name : Install dependencies
83- if : steps.detect.outputs.method == 'pyproject'
84- run : uv pip install --system "$(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)"
85- - name : pre-commit (installed)
86- if : steps.detect.outputs.method == 'requirements' || steps.detect.outputs.method == 'pyproject'
8779 run : |
80+ uv pip install --system -r requirements-lint.txt
8881 pre-commit run --all --show-diff-on-failure
8982 pre-commit gc
9083 env :
0 commit comments