Created
December 9, 2024 18:34
-
-
Save CAMOBAP/c1c0811994b40c7b8a0fb1020997bdb8 to your computer and use it in GitHub Desktop.
GHA remove cache by regex
This file contains hidden or 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
gh api -H "Accept: application/vnd.github+json" /repos/metanorma/metanorma-ietf/actions/caches \ | |
| jq -r '.actions_caches[].key' | grep -E 'chocolatey-cache' \ | |
| ruby -r 'cgi' -e 'while line = gets; puts CGI.escape(line.strip); end' \ | |
| xargs -n 1 --no-run-if-empty -S 2048 -I {} \ | |
env PAGER=cat gh api -X DELETE -H "Accept: application/vnd.github+json" "/repos/metanorma/metanorma-ietf/actions/caches?key={}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment