Ensure save/restore only on first action step

Instead of relying on the separate cache implementations to check for the
existence of cached products, we now explicitly track whether or not the execution
is the first time the action has been invoked for a job.
This commit is contained in:
Daz DeBoer 2021-12-07 12:56:36 -07:00
parent 253d6427fd
commit 1041604f29
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
4 changed files with 45 additions and 38 deletions

View file

@ -294,12 +294,6 @@ export class GradleUserHomeCache extends AbstractCache {
return path.resolve(os.homedir(), '.gradle')
}
protected cacheOutputExists(): boolean {
// Need to check for 'caches' directory to avoid incorrect detection on MacOS agents
const dir = path.resolve(this.gradleUserHome, 'caches')
return fs.existsSync(dir)
}
/**
* Determines the paths within Gradle User Home to cache.
* By default, this is the 'caches' and 'notifications' directories,