Bläddra i källkod

Merge pull request #6106 from GeorgeK1ng/cache_pr_removal_fix

Fix cache cleanup on closed PR
Ivan Savenko 1 månad sedan
förälder
incheckning
566e7e5408
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. 3 3
      .github/workflows/cache_cleanup.yml

+ 3 - 3
.github/workflows/cache_cleanup.yml

@@ -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