Last active
October 17, 2022 16:11
-
-
Save jcoyne/4a0ec3606cefbe4d9d11748212ed7179 to your computer and use it in GitHub Desktop.
Clear github caches
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
TOKEN = ENV['GH_TOKEN'] | |
REPO = ENV['GH_REPO'] | |
ids = `curl -s \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token #{TOKEN}" \ | |
https://api.github.com/repos/#{REPO}/actions/caches | jq '.actions_caches[].id'` | |
ids.split.each do |id| | |
`curl -s \ | |
-X DELETE \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token #{TOKEN}" \ | |
"https://api.github.com/repos/#{REPO}/actions/caches/#{id}"` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment