[CI] Update cleanup-cache action (#20788)

This commit is contained in:
Mac Siri 2024-03-21 18:24:40 -04:00 committed by GitHub
parent e1ebe05623
commit b0cc94e655
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,17 +8,12 @@ jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
@ -30,4 +25,5 @@ jobs:
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge