LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gh-cache

manage GitHub Actions workflow caches

TLDR

List caches for the current repository
$ gh cache list
copy
List caches sorted by size
$ gh cache list --sort size_in_bytes --order desc
copy
Filter caches by key prefix
$ gh cache list --key [key_prefix]
copy
Delete a cache by ID or key
$ gh cache delete [cache_id_or_key]
copy
Delete all caches for a specific ref
$ gh cache delete --all --ref refs/heads/[branch]
copy
Delete all caches in the repository
$ gh cache delete --all
copy

SYNOPSIS

gh cache subcommand [options]

DESCRIPTION

gh cache manages GitHub Actions caches for a repository. Caches store dependencies and build artifacts to speed up workflow execution by reusing data between runs.The cache system uses key-based storage, where workflows save and restore cached data using unique keys. Cache entries have size limits and are automatically evicted based on usage policies. Managing caches manually helps troubleshoot workflow issues and reclaim storage.`gh cache list` can also be invoked as `gh cache ls`.

PARAMETERS

-k, --key prefix

Filter by cache key prefix (list), or match by key (delete).
-L, --limit N
Maximum number of caches to fetch (default: 30). (list only)
-S, --sort field
Sort by field: createdat, lastaccessedat, sizeinbytes (default: lastaccessed_at). (list only)
-O, --order direction
Order of results: asc or desc (default: desc). (list only)
-r, --ref ref
Filter or delete by ref, e.g. refs/heads/main or refs/pull/123/merge.
-a, --all
Delete all caches. May be combined with --ref to limit scope.
--succeed-on-no-caches
Return exit code 0 if no caches are found (used with --all).
--json fields
Output JSON with specified fields. (list only)
-q, --jq expression
Filter JSON output using a jq expression. (list only)
-t, --template format
Format JSON output using a Go template. (list only)
-R, --repo owner/repo
Target a specific repository.

SUBCOMMANDS

list

List caches for the current repository.
delete
Delete one or more caches by ID, key, or all at once.

INSTALL

sudo apt install gh
copy
sudo dnf install gh
copy
sudo pacman -S github-cli
copy
sudo apk add github-cli
copy
sudo zypper install gh
copy
brew install gh
copy
nix profile install nixpkgs#gh
copy

SEE ALSO

gh(1), gh-run(1), gh-secret(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid