Created
October 9, 2022 16:14
-
-
Save tsl0922/2042791664678437ab885d98b6291bdc to your computer and use it in GitHub Desktop.
Clear github actions cache
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
REPO="OWNER/REPO" | |
TOKEN="TOKEN" | |
for id in $(curl -s \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${TOKEN}" \ | |
https://api.github.com/repos/${REPO}/actions/caches | jq -r '.actions_caches[] | .id'); do | |
echo "Deleting cache with id: $id..." | |
curl -X DELETE \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${TOKEN}" \ | |
https://api.github.com/repos/${REPO}/actions/caches/${id} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment