Created
February 4, 2023 02:55
-
-
Save FluxCapacitor2/09c7a3ce5c9875b495ea06304b82c0dd to your computer and use it in GitHub Desktop.
Remove all GitHub Actions caches for a repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires the "gh" CLI | |
# https://cli.github.com/ | |
# Install the GitHub Actions cache extension for the GitHub CLI | |
gh extension install actions/gh-actions-cache | |
# Purge the 100 oldest cache entries | |
# (running the script multiple times may cause a rate limit to be hit; this can be solved by waiting a few minutes) | |
gh actions-cache list -L 100 --sort last-used --order asc | awk '{print $1}' | xargs -d\\n -n1 gh actions-cache delete --confirm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment