mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-07-12 10:15:51 +02:00
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:
parent
253d6427fd
commit
1041604f29
4 changed files with 45 additions and 38 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue