Skip to content

Commit f65a11b

Browse files
authored
Prevalidate presence of precommit cache tarball instead of hard failing (#49806)
1 parent 59e7606 commit f65a11b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/actions/install-pre-commit/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ runs:
6161
key: cache-pre-commit-v4-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
6262
path: /tmp/
6363
id: restore-pre-commit-cache
64+
- name: "Check if pre-commit cache tarball exists"
65+
shell: bash
66+
run: |
67+
if [ -f /tmp/cache-pre-commit.tar.gz ]; then
68+
echo "✅ Cache tarball found: /tmp/cache-pre-commit.tar.gz"
69+
else
70+
echo "❌ Cache tarball missing. Expected /tmp/cache-pre-commit.tar.gz"
71+
exit 1
72+
fi
73+
if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
6474
- name: "Restore .cache from the tar file"
6575
run: tar -C ~ -xzf /tmp/cache-pre-commit.tar.gz
6676
shell: bash

0 commit comments

Comments
 (0)