Skip to content

Commit 2bd2770

Browse files
committed
chore(run-pre-commit): Add comment to explain cache-dependency-path
1 parent 7394de7 commit 2bd2770

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

run-pre-commit/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ runs:
3333
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
3434
with:
3535
python-version: ${{ inputs.python-version }}
36+
# It doesn't make a whole lot of sense to use the pre-commit config file
37+
# as the dependency file, but the setup-python action looks for
38+
# requirements.txt and pyproject.toml by default, which are both not
39+
# present (in most cases). To override these two defaults, we need to
40+
# specify a different file. Specifying the pre-commit config at least
41+
# guarantees that the cache is invalidated if the config changes.
42+
# Ideally we want to invalidate when the pre-commit or Python version
43+
# changes, but that's not easily possible.
3644
cache-dependency-path: .pre-commit-config.yaml
3745
cache: 'pip'
3846

0 commit comments

Comments
 (0)