From 3130475f298f09666785c732a9869670c4962328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lder=20Greg=C3=B3rio?= Date: Thu, 22 Oct 2026 21:53:41 +0100 Subject: [PATCH] MINOR: [CI] Key pre-commit caches by Python version The pre-commit cache contains interpreter-specific environments, but its current key only hashes the hook configuration while setup-python selects a floating 3.x version. Include the runner OS and resolved Python version so an image update does not restore environments tied to a different interpreter. --- .github/workflows/dev.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index f4dc9ad6f1..509972e7fa 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -41,13 +41,14 @@ jobs: persist-credentials: false - uses: actions/setup-python@v7 + id: python with: python-version: '3.x' - name: pre-commit (cache) uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.cache/pre-commit - key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + key: pre-commit-${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} - name: pre-commit (--all-files) run: | python -m pip install pre-commit