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.
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.
- 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.