mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-09-16 04:32:22 +08:00
@@ -10,6 +10,7 @@ export class CacheListener {
|
||||
cacheReadOnly = false
|
||||
cacheWriteOnly = false
|
||||
cacheDisabled = false
|
||||
cacheDisabledReason = 'disabled'
|
||||
|
||||
get fullyRestored(): boolean {
|
||||
return this.cacheEntries.every(x => !x.wasRequestedButNotRestored())
|
||||
@@ -17,7 +18,7 @@ export class CacheListener {
|
||||
|
||||
get cacheStatus(): string {
|
||||
if (!cache.isFeatureAvailable()) return 'not available'
|
||||
if (this.cacheDisabled) return 'disabled'
|
||||
if (this.cacheDisabled) return this.cacheDisabledReason
|
||||
if (this.cacheWriteOnly) return 'write-only'
|
||||
if (this.cacheReadOnly) return 'read-only'
|
||||
return 'enabled'
|
||||
|
@@ -29,6 +29,8 @@ export async function restore(gradleUserHome: string, cacheListener: CacheListen
|
||||
core.info('Gradle User Home already exists: will not restore from cache.')
|
||||
// Initialize pre-existing Gradle User Home.
|
||||
gradleStateCache.init()
|
||||
cacheListener.cacheDisabled = true
|
||||
cacheListener.cacheDisabledReason = 'disabled due to pre-existing Gradle User Home'
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user