actions /cache

Cache dependencies and build outputs in GitHub Actions

★ 5,602⑂ 1,617👁 124⑃ 616● 898▤ 74
TypeScriptMITCreated 2019-10-16
More from this author
Download: v6.1.0v6.1.0 ↓6.1.02026-06-26
+2
Daily
5,602
stars
1,617
forks
124
watchers
616
prs
898
issues
74
releases

README

Cache action

This action allows caching dependencies and build outputs to improve workflow execution time.

Two other actions are available in addition to the primary cache action:

 Restore action
 Save action



 Documentation

See "Caching dependencies to speed up workflows".

 What's New

 ⚠️ Important changes

 [!IMPORTANT]
 actions/cache@v5 runs on the Node.js 24 runtime and requires a minimum Actions Runner version of 2.327.1.
 If you are using self-hosted runners, ensure they are updated before upgrading.

The cache backend service has been rewritten from the ground up for improved performance and reliability. actions/cache now integrates with the new cache service (v2) APIs.

The new service will gradually roll out as of February 1st, 2025. The legacy service will also be sunset on the same date. Changes in these releases are fully backward compatible.

We are deprecating some versions of this action. We recommend upgrading to version v4 or v3 as soon as possible before February 1st, 2025. (Upgrade instructions below).

If you are using pinned SHAs, please use the SHAs of versions v4.2.0 or v3.4.0.

If you do not upgrade, all workflow runs using any of the deprecated actions/cache will fail.

Upgrading to the recommended versions will not break your workflows.

 Additionally, if you are managing your own GitHub runners, you must update your runner version to 2.231.0 or newer to ensure compatibility with the new cache service.
 Failure to update both the action version and your runner version may result in workflow failures after the migration date.

Read more about the change & access the migration guide: reference to the announcement.

 v6

 Updated @actions/cache, @actions/core, @actions/exec to latest major versions
 Migrated to ESM module system

 v5

 Updated to node 24
 Requires a minimum Actions Runner version of 2.327.1

 v4

 Integrated with the new cache service (v2) APIs.
 Updated to node 20

 v3

 Integrated with the new cache service (v2) APIs.
 Added support for caching in GHES 3.5+.
 Fixed download issue for files  2GB during restore.
 Updated the minimum runner version support from node 12 - node 16.
 Fixed avoiding empty cache save when no files are available for caching.
 Fixed tar creation error while trying to create tar with path as ~/ home folder on ubuntu-latest.
 Fixed zstd failing on amazon linux 2.0 runners.
 Fixed cache not working with github workspace directory or current directory.
 Fixed the download stuck problem by introducing a timeout of 1 hour for cache downloads.
 Fix zstd not working for windows on gnu tar in issues.
 Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable SEGMENT_DOWNLOAD_TIMEOUT_MINS. Default is 10 minutes.
 New actions are available for granular control over caches - restore and save.
 Support cross-os caching as an opt-in feature. See Cross OS caching for more info.
 Added option to fail job on cache miss. See Ex

Top issues

Discussions

Latest release

v6.1.0 v6.1.0 2026-06-26
What's Changed
 Bump @actions/cache to v6.1.0 - handle read-only cache access by @jasongin in https://github.com/actions/cache/pull/1768


Full Changelog: https://github.com/actions/cache/compare/v6...v6.1.0

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON