Unverified Commit b02f4f19 authored by Daz DeBoer's avatar Daz DeBoer
Browse files

Disable cache-read-only when cache-write-only is set

parent 0a36ca9f
Loading
Loading
Loading
Loading
+7 −4
Changes for action.yml: 7 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@ inputs:
  # e.g. Use the following setting to only write cache entries from your 'main' branch
  #     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:
    description: Paths within Gradle User Home to cache.
    required: false
@@ -52,10 +59,6 @@ inputs:
  # 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`.
  # 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:
    description: When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs.
    required: false
+1 −1
Changes for src/cache-utils.ts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ export function isCacheDisabled(): boolean {
}

export function isCacheReadOnly(): boolean {
    return core.getBooleanInput(CACHE_READONLY_PARAMETER)
    return !isCacheWriteOnly() && core.getBooleanInput(CACHE_READONLY_PARAMETER)
}

export function isCacheWriteOnly(): boolean {