1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Merge pull request #6106 from GeorgeK1ng/cache_pr_removal_fix

Fix cache cleanup on closed PR
This commit is contained in:
Ivan Savenko
2025-09-07 16:03:16 +03:00
committed by GitHub

View File

@@ -1,4 +1,4 @@
name: Cleanup GitHub runner caches on closed pull requests
name: Cleanup GitHub runner caches on closed PRs
on:
pull_request:
types:
@@ -16,8 +16,8 @@ jobs:
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
# List caches whose key contains "-PR-<number>"
ids=$(gh cache list --limit 2000 --json id,key --jq ".[] | select(.key | contains(\"-PR-${PR_NUMBER}\")) | .id")
# List caches whose key contains "-PR-<number>-"
ids=$(gh cache list --limit 2000 --json id,key --jq ".[] | select(.key | test(\"-PR-${PR_NUMBER}-\")) | .id")
# Delete them (best effort)
set +e