From 97f1f342740a76148863c55298774c66180f13a9 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Wed, 13 Sep 2023 09:47:03 +0200 Subject: [PATCH] Delete missing/multiple/duplicate caches in "pre-commit" job "gh cache list" may occasionally give zero results; multiple results; or multiple results with the same cache key. Allow all of these to succeed with exit code 0. --- .github/workflows/pytest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 547b1c3dfa..7391443f43 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -113,7 +113,7 @@ jobs: - name: Force recreation of pre-commit virtual environment for mypy if: github.event_name == 'schedule' # Comment this line to run on a PR - run: gh cache delete $(gh cache list -L 999 | cut -f2 | grep pre-commit) + run: gh cache list -L 999 | cut -f2 | grep pre-commit | xargs -I{} 'gh cache delete "{}" || true' env: { GH_TOKEN: "${{ github.token }}" } - uses: pre-commit/action@v3.0.0