From 83edd4dadee5b27d32f6cd61b0994fb8911880ad Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Thu, 9 Oct 2025 12:01:53 +0900 Subject: [PATCH] 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. --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 18ded0d..62bf2fa 100644 --- a/action.yml +++ b/action.yml @@ -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') }}