From 12cb23c3592644ffc8d3607583c6e320eb26ad01 Mon Sep 17 00:00:00 2001 From: daz Date: Fri, 19 Jul 2024 15:28:39 -0600 Subject: [PATCH] Enable cache-cleanup 'on-success' by default Fixes #26 --- setup-gradle/action.yml | 2 +- sources/src/caching/cache-reporting.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-gradle/action.yml b/setup-gradle/action.yml index ff0ca799..4f447494 100644 --- a/setup-gradle/action.yml +++ b/setup-gradle/action.yml @@ -46,7 +46,7 @@ inputs: By default, no cleanup is performed. It can be configured to run every time, or only when all Gradle builds succeed for the Job. Valid values are 'never', 'on-success' and 'always'. required: false - default: 'never' + default: 'on-success' gradle-home-cache-cleanup: description: When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache. diff --git a/sources/src/caching/cache-reporting.ts b/sources/src/caching/cache-reporting.ts index 2ad07eb3..31f986c1 100644 --- a/sources/src/caching/cache-reporting.ts +++ b/sources/src/caching/cache-reporting.ts @@ -12,9 +12,9 @@ export const EXISTING_GRADLE_HOME = `[Cache was disabled to avoid overwriting a export const CLEANUP_DISABLED_READONLY = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) is always disabled when cache is read-only or disabled.` -export const DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was not enabled. It must be explicitly enabled.` +export const DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled. Stale files in Gradle User Home were purged before saving to the cache.` -export const DEFAULT_CLEANUP_ENABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was enabled.` +export const DEFAULT_CLEANUP_DISABLED_REASON = `[Cache cleanup](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup) was disabled via action parameter. No cleanup of Gradle User Home was performed.` export const CLEANUP_DISABLED_DUE_TO_FAILURE = '[Cache cleanup was disabled due to build failure](https://github.com/gradle/actions/blob/v3/docs/setup-gradle.md#enabling-cache-cleanup). Use `cache-cleanup: always` to override this behavior.'