mirror of
https://github.com/pre-commit/action.git
synced 2025-11-07 10:46:56 +00:00
add cache restore key and run gc in post step
This will allow us to restore all available cached hooks to reduce the time spent "Initializing environment" on each run. If any of the hooks are updated, the `pre-commit gc` command will remove the now-unused hooks from ~/.cache/pre-commit, ensuring that we don't store them in the cache indefinitely.
This commit is contained in:
parent
576ff52938
commit
9a134f4f53
1 changed files with 5 additions and 0 deletions
|
|
@ -16,5 +16,10 @@ runs:
|
|||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
restore-keys: |
|
||||
pre-commit-3|${{ env.pythonLocation }}|
|
||||
pre-commit-3|
|
||||
- run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }}
|
||||
shell: bash
|
||||
- run: pre-commit gc
|
||||
shell: bash
|
||||
|
|
|
|||
Loading…
Reference in a new issue