From a91393a988bc34b5ba3102720f3ccdd8f2848cc2 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Mon, 4 Nov 2024 18:01:12 +0100 Subject: [PATCH] Fix clear caches pagination (#262) --- .github/workflows/clear-caches.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clear-caches.yaml b/.github/workflows/clear-caches.yaml index c2c54cbc..ec024cae 100644 --- a/.github/workflows/clear-caches.yaml +++ b/.github/workflows/clear-caches.yaml @@ -14,11 +14,13 @@ jobs: uses: actions/github-script@v7 with: script: | - 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.endpoint.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + }) + ) + for (const cache of caches) { console.log(cache) github.rest.actions.deleteActionsCacheById({ owner: context.repo.owner,