Skip to content

Commit

Permalink
Delete missing/multiple/duplicate caches in "pre-commit" job
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
khaeru committed Sep 13, 2023
1 parent 93abbf7 commit 97f1f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 97f1f34

Please sign in to comment.