[CI] Keep at laest one cache for main in GC CI

This commit fixes an issue that caches in main are removed by GC CI
This commit is contained in:
Hideto Ueno 2025-06-24 14:27:35 -07:00
parent ec988bbafb
commit 55c3fefb8c
1 changed files with 2 additions and 3 deletions

View File

@ -32,6 +32,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Keep top 3 caches (in the case LLVM bump involved)
gh cache list -k ${{ matrix.key_prefix }} -L 50
gh cache list -k ${{ matrix.key_prefix }} -L 50 --jq ".[3:]|.[].id" --json id | ./utils/delete-cache.sh
gh cache list -k ${{ matrix.key_prefix }} -L 50 --ref "refs/heads/main"
gh cache list -k ${{ matrix.key_prefix }} -L 50 --ref "refs/heads/main" --jq ".[1:]|.[].id" --json id | ./utils/delete-cache.sh