mirror of
https://github.com/pre-commit/action.git
synced 2025-11-07 10:46:56 +00:00
Update action.yml
## Motivation In my experience, the cache of pre-commits can be quite large. It takes a couple of minutes to fetch the cache in GitHub Actions. I assume it might be faster to install hooks than to fetch cache. So, it would be useful to add an input `enable_cache` if we cache pre-commit hooks or not.
This commit is contained in:
parent
1b06ec171f
commit
83edd4dade
1 changed files with 5 additions and 0 deletions
|
|
@ -5,6 +5,10 @@ inputs:
|
|||
description: options to pass to pre-commit run
|
||||
required: false
|
||||
default: '--all-files'
|
||||
enable_cache:
|
||||
description: Whether to cache pre-commit hooks
|
||||
required: false
|
||||
default: 'true'
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
|
|
@ -13,6 +17,7 @@ runs:
|
|||
- run: python -m pip freeze --local
|
||||
shell: bash
|
||||
- uses: actions/cache@v4
|
||||
if: inputs.enable_cache == 'true'
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue