Skip to content

Commit 81b4ece

Browse files
authored
Clarify that tags are isolated in cache entries
1 parent cdbbabd commit 81b4ece

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/setup-gradle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Using either of these mechanisms may interfere with the caching provided by this
218218

219219
The GitHub Actions cache has some properties that present problems for efficient caching of the Gradle User Home.
220220
- Immutable entries: once a cache entry is written for a key, it cannot be overwritten or changed.
221-
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
221+
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches or tags. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
222222
- Restore keys: if no exact match is found, a set of partial keys can be provided that will match by cache key prefix. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
223223

224224
Each of these properties has influenced the design and implementation of the caching in `setup-gradle`, as described below.
@@ -316,8 +316,8 @@ Some techniques can be used to avoid/mitigate this issue:
316316

317317
### Select which branches should write to the cache
318318

319-
GitHub cache entries are not shared between builds on different branches.
320-
Workflow runs can restore caches created in either the current branch or the default branch (usually main).
319+
GitHub cache entries are not shared between builds on different branches or tags.
320+
Workflow runs can _only_ restore caches created in either the same branch or the default branch (usually `main`).
321321
This means that each branch will have its own Gradle User Home cache scope, and will not benefit from cache entries written for other (non-default) branches.
322322

323323
By default, The `setup-gradle` action will only _write_ to the cache for builds run on the default (`master`/`main`) branch.

0 commit comments

Comments
 (0)