From f10323bb09e74819f4942e79cd2ecf417ce15569 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 8 Feb 2024 10:28:49 +0100 Subject: [PATCH] ci: update clear-caches.yml (#11875) --- .github/workflows/clear-caches.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/clear-caches.yml b/.github/workflows/clear-caches.yml index 47e5ac48753..cecce9ff936 100644 --- a/.github/workflows/clear-caches.yml +++ b/.github/workflows/clear-caches.yml @@ -14,15 +14,20 @@ jobs: runs-on: ubuntu-latest steps: - name: Clear Firefox cache - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83 # v7.0.1 with: script: | console.log("Querying") - const caches = await github.rest.actions.getActionsCacheList({ - owner: context.repo.owner, - repo: context.repo.repo, - }) - for (const cache of caches.data.actions_caches) { + + const caches = await github.paginate( + github.rest.actions.getActionsCacheList, + { + owner: context.repo.owner, + repo: context.repo.repo, + } + ) + console.log(caches.length) + for (const cache of caches) { if (cache.key.toLowerCase().startsWith('firefox')) { console.log(cache) github.rest.actions.deleteActionsCacheById({