diff --git a/.github/workflows/cleanup.yaml b/.github/workflows/cleanup.yaml index 5cd1b70af..bb124f47c 100644 --- a/.github/workflows/cleanup.yaml +++ b/.github/workflows/cleanup.yaml @@ -22,20 +22,10 @@ jobs: cleanup: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Cleanup - run: | - echo "Fetching list of cache key" - 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 cache delete $cacheKey - done - echo "Done" + run: gh cache list --ref $BRANCH --json id --jq '.[].id' | xargs -I {} gh cache delete {} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} - BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge \ No newline at end of file + BRANCH: refs/pull/${{ github.event.number }}/merge \ No newline at end of file