From 7f905d4e612b1cc868abd8175dbca647d8d2c9c7 Mon Sep 17 00:00:00 2001 From: Constrat <56174894+Constrat@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:16:07 +0200 Subject: [PATCH] ci: delete stale cache for codeql (#13335) --- .github/workflows/codeql.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 11358062b3..a124122515 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -76,3 +76,14 @@ uses: github/codeql-action/analyze@v3 with: category: "/language:multi-manual" + + - name: Delete old caches + shell: pwsh + run: | + $oldCaches = gh cache list --key codeql --order asc --json key | ConvertFrom-Json | Select-Object -SkipLast 1 + foreach ($cache in $oldCaches) { + if ($cache.key) { + Write-Host "Deleting cache: $($cache.key)" + gh cache delete $cache.key + } + }