From 712db81bda6ef2811bd4c0012ddb965ff904997e Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:04:23 +0200 Subject: [PATCH] done --- .github/workflows/cleanup-caches-by-branches.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cleanup-caches-by-branches.yml b/.github/workflows/cleanup-caches-by-branches.yml index bd3f5e3290b2..bcce070aba64 100644 --- a/.github/workflows/cleanup-caches-by-branches.yml +++ b/.github/workflows/cleanup-caches-by-branches.yml @@ -8,23 +8,23 @@ on: jobs: cleanup: runs-on: ubuntu-latest + permissions: + actions: write steps: - name: Cleanup run: | - gh extension install actions/gh-actions-cache - - echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) + echo "Fetching list of cache keys" + cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id') ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + gh cache delete $cacheKey done echo "Done" env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge