Skip to content

Commit

Permalink
Test purge caches
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed Oct 11, 2024
1 parent af23a15 commit 225add7
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/purge-cache.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Purge caches
on:
schedule:
# 4:10 UTC Sunday
- cron: "10 4 * * 0"
# 17:15 UTC Friday
- cron: "15 17 * * 5"

workflow-dispatch:

Expand All @@ -16,21 +16,7 @@ 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 )
## 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"
echo "Test purge cache."
run-test-files:
name: Run test-files
Expand Down

0 comments on commit 225add7

Please sign in to comment.