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:
6
.github/workflows/cache_cleanup.yml
vendored
6
.github/workflows/cache_cleanup.yml
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user