Skip to main content

Dependency caching reference

Find information on the functionality of dependency caching in workflows.

cache action usage

The cache action will attempt the following sequence when restoring a cache:

  1. First, it searches for an exact match to your provided key.
  2. If no exact match is found, it will search for partial matches of the key.
  3. If there is still no match found, and you've provided restore-keys, these keys will be checked sequentially for partial matches. For more information, see Cache key matching.

If there is an exact match to the provided key, this is considered a cache hit. If no cache exactly matches the provided key, this is considered a cache miss. On a cache miss, the action automatically creates a new cache if the job completes successfully. The new cache will use the key you provided and contains the files you specify in path. For more information about how this is handled, see Cache hits and misses.

You cannot change the contents of an existing cache. Instead, you can create a new cache with a new key.