mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-26 11:02:10 +00:00
Disable cache-read-only when cache-write-only is set
This commit is contained in:
parent
0a36ca9fb8
commit
b02f4f1968
2 changed files with 8 additions and 5 deletions
11
action.yml
11
action.yml
|
@ -22,6 +22,13 @@ inputs:
|
||||||
# e.g. Use the following setting to only write cache entries from your 'main' branch
|
# e.g. Use the following setting to only write cache entries from your 'main' branch
|
||||||
# cache-read-only: ${{ github.ref_name != 'main' }}
|
# cache-read-only: ${{ github.ref_name != 'main' }}
|
||||||
|
|
||||||
|
cache-write-only:
|
||||||
|
description: |
|
||||||
|
When 'true', entries will not be restored from the cache but will be saved at the end of the Job.
|
||||||
|
Setting this to 'true' implies cache-read-only will be 'false'.
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
gradle-home-cache-includes:
|
gradle-home-cache-includes:
|
||||||
description: Paths within Gradle User Home to cache.
|
description: Paths within Gradle User Home to cache.
|
||||||
required: false
|
required: false
|
||||||
|
@ -52,10 +59,6 @@ inputs:
|
||||||
# The following action properties allow fine-grained tweaking of the action caching behaviour.
|
# The following action properties allow fine-grained tweaking of the action caching behaviour.
|
||||||
# These properties are experimental and not (yet) designed for production use, and may change without notice in a subsequent release of `gradle-build-action`.
|
# These properties are experimental and not (yet) designed for production use, and may change without notice in a subsequent release of `gradle-build-action`.
|
||||||
# Use at your own risk!
|
# Use at your own risk!
|
||||||
cache-write-only:
|
|
||||||
description: When 'true', entries will not be restored from the cache but will be saved at the end of the Job. This allows a 'clean' cache entry to be written.
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
gradle-home-cache-strict-match:
|
gradle-home-cache-strict-match:
|
||||||
description: When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs.
|
description: When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs.
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -27,7 +27,7 @@ export function isCacheDisabled(): boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isCacheReadOnly(): boolean {
|
export function isCacheReadOnly(): boolean {
|
||||||
return core.getBooleanInput(CACHE_READONLY_PARAMETER)
|
return !isCacheWriteOnly() && core.getBooleanInput(CACHE_READONLY_PARAMETER)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isCacheWriteOnly(): boolean {
|
export function isCacheWriteOnly(): boolean {
|
||||||
|
|
Loading…
Reference in a new issue