Skip to content

Commit

Permalink
Revise script for purging cache.
Browse files Browse the repository at this point in the history
Use gh cache instead of gh actions-cache
  • Loading branch information
mrclary committed Oct 14, 2024
1 parent 065afeb commit 02135f1
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
echo "Fetching list of cache key"
allCaches=$(gh actions-cache list -L 100 -R $REPO | cut -f 1 )
gh cache list --repo $REPO
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $allCaches
do
gh actions-cache delete $cacheKey -R $REPO --confirm
done
echo "Done"
gh cache delete --repo $REPO --all
# Last command must be successful so that workflow step does not fail
echo Purging cache is complete.
run-test-files:
name: Run test-files
Expand Down

0 comments on commit 02135f1

Please sign in to comment.