mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Finish enabling cache-cleanup by default
- Add deprecation warning for `gradle-home-cache-cleanup` - Change default for `dependency-submission` to `cache-cleanup: on-success` - Update documentation for changed default
This commit is contained in:
@@ -143,6 +143,14 @@ export class CacheConfig {
|
||||
}
|
||||
|
||||
private getCacheCleanupOption(): CacheCleanupOption {
|
||||
const legacyVal = getOptionalBooleanInput('gradle-home-cache-cleanup')
|
||||
if (legacyVal !== undefined) {
|
||||
deprecator.recordDeprecation(
|
||||
'The `gradle-home-cache-cleanup` input parameter has been replaced by `cache-cleanup`'
|
||||
)
|
||||
return legacyVal ? CacheCleanupOption.Always : CacheCleanupOption.Never
|
||||
}
|
||||
|
||||
const val = core.getInput('cache-cleanup')
|
||||
switch (val.toLowerCase().trim()) {
|
||||
case 'always':
|
||||
@@ -150,10 +158,7 @@ export class CacheConfig {
|
||||
case 'on-success':
|
||||
return CacheCleanupOption.OnSuccess
|
||||
case 'never':
|
||||
// When set to 'never' (the default), honour the legacy parameter setting.
|
||||
return getBooleanInput('gradle-home-cache-cleanup')
|
||||
? CacheCleanupOption.Always
|
||||
: CacheCleanupOption.Never
|
||||
return CacheCleanupOption.Never
|
||||
}
|
||||
throw TypeError(
|
||||
`The value '${val}' is not valid for cache-cleanup. Valid values are: [never, always, on-success].`
|
||||
|
||||
Reference in New Issue
Block a user