mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Ensure minimum Gradle version for cache-cleanup (#364)
Instead of always installing and using the latest Gradle version for cache cleanup, we now require at least Gradle 8.9. This avoids downloading and installing Gradle if the version on PATH is sufficient to perform cache cleanup.
This commit is contained in:
@@ -55,11 +55,12 @@ export class CacheCleaner {
|
||||
)
|
||||
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
||||
|
||||
const executable = await provisioner.provisionGradle('current')
|
||||
// Gradle >= 8.9 required for cache cleanup
|
||||
const executable = await provisioner.provisionGradleAtLeast('8.9')
|
||||
|
||||
await core.group('Executing Gradle to clean up caches', async () => {
|
||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`)
|
||||
await this.executeCleanupBuild(executable!, cleanupProjectDir)
|
||||
await this.executeCleanupBuild(executable, cleanupProjectDir)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user