GitHub Actions cache "size exceeds 10GB limit"
A single cache entry cannot exceed 10GB. Caching huge directories (full toolchains, node_modules plus build output, container layers) trips the ceiling and the save is rejected. This is a deterministic limit, not a flake.
What this error means
The cache save step fails reporting the cache size exceeds the maximum allowed, and nothing is saved for that key.
github-actions
Error: Cache size of ~11.4 GB exceeds the 10 GB limit, not saving cache.Common causes
Caching too much in one entry
Broad paths bundle build output, dependencies, and generated files into a single oversized cache.
No exclusions for large transient files
Large logs, coverage data, or duplicate artifacts inflate the cache past the limit.
How to fix it
Cache less per key
- Cache only the dependency directory needed for warm builds, not full build output.
- Split unrelated caches into separate keys/paths.
- Prune large transient files before the cache save runs.
.github/workflows/ci.yml
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
node_modules
key: deps-${{ hashFiles('**/lockfiles') }}How to prevent it
- Keep each cache entry well under 10GB by scoping paths tightly.
- Exclude generated/transient files from cached paths.
Related guides
GitHub Actions cache "tar: Cannot mkdir: Permission denied"Fix the GitHub Actions cache error where tar cannot create the cache directory due to a permission denied.
GitHub Actions cache "another job is already creating this cache"Fix the GitHub Actions cache warning where another job is already creating the same cache key concurrently.
GitHub Actions "secret too large (64KB limit)"Fix the GitHub Actions error where a secret value exceeds the 64KB size limit.