Which actions/cache behavior occurs when the primary key is a cache miss but a restore-key partially matches?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A restore-key partial hit restores the old cache to warm-start the run, then saves a fresh cache under the primary key when the job succeeds.
Full explanation below image
Full Explanation
When actions/cache finds a partial match via restore-keys: (1) The matching cache is restored to the specified 'path'; (2) The job runs with this potentially outdated cache (e.g., some new packages may need to be downloaded); (3) At job completion (if successful), a new cache entry is saved with the primary key. This 'stale cache warmup' pattern means even partial hits are useful — you restore most of the dependencies rather than starting cold. The cache saved at the end will be an exact match for future runs. This is the core value of restore-keys: ordered fallback with gradual cache refinement.