capabilities.work

Prune Repository Caches

A 3-step recipe with GitHub Actions. We can help you get access.

Recipe · 3 steps

Prune Repository Caches

Works with AI assistants

Find and delete the largest Actions cache in a repository.

  1. Read the repository's aggregate Actions cache usage to report how much space is currently consumed.
  2. List caches sorted by size in descending order so the largest cache is the first entry. Branch to the end when there are no caches.
  3. Delete the largest cache by its id. Returns 204 with no body on success.
What you'll need to have ready
  • accessToken: GitHub bearer token with Actions write access.
  • owner: The account owner of the repository.
  • repo: The name of the repository without the .git extension.
For your developer

Arazzo workflow github-actions:prune-repo-caches, 3 operations: getActionsCacheUsage → listActionsCaches → deleteActionsCacheById. Specs on APIs.io.