Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Last active October 17, 2022 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcoyne/4a0ec3606cefbe4d9d11748212ed7179 to your computer and use it in GitHub Desktop.
Save jcoyne/4a0ec3606cefbe4d9d11748212ed7179 to your computer and use it in GitHub Desktop.
Clear github caches
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