Skip to content

Commit

Permalink
Update description of cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz authored Jan 10, 2024
1 parent 7af8983 commit 1a18d0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,20 @@ For this reason, it's very difficult to create a cache key that will determinist

The Gradle User Home cache key is composed of:
- The current operating system (`RUNNER_OS`)
- The workflow name and Job ID
- A hash of the Job matrix parameters
- The Job id
- A hash of the Job matrix parameters and the workflow name
- The git SHA for the latest commit

Specifically, the cache key is: `${cache-protocol}-gradle|${runner-os}|${workflow-name}-${job-id}[${hash-of-job-matrix}]-${git-sha}`
Specifically, the cache key is: `${cache-protocol}-gradle|${runner-os}|${job-id}[${hash-of-job-matrix-and-workflow-name}]-${git-sha}`

As such, the cache key is likely to change on each subsequent run of GitHub actions.
This allows the most recent state to always be available in the GitHub actions cache.

### Finding a matching cache entry

In most cases, no exact match will exist for the cache key. Instead, the Gradle User Home will be restored for the closest matching cache entry, using a set of "restore keys". The entries will be matched with the following precedence:
- An exact match on OS, workflow name, job id, matrix and Git SHA
- The most recent entry saved for the same OS, workflow name, job id and matrix values
- An exact match on OS, job id, workflow name, matrix and Git SHA
- The most recent entry saved for the same OS, job id, workflow name and matrix values
- The most recent entry saved for the same OS and job id
- The most recent entry saved for the same OS

Expand Down

0 comments on commit 1a18d0b

Please sign in to comment.