feat: add option to disable cache pruning (#134)
This PR adds an input to control whether or not the cache is pruned before saving. Closes #122 --------- Co-authored-by: Kevin Stillhammer <[email protected]> Co-authored-by: Charlie Marsh <[email protected]> Co-authored-by: Charlie Marsh <[email protected]>
This commit is contained in:
co-authored by
Kevin Stillhammer
Charlie Marsh
Charlie Marsh
parent
cf841c25e2
commit
3b9817b1bf
+8
-2
@@ -5,7 +5,11 @@ import {
|
||||
STATE_CACHE_MATCHED_KEY,
|
||||
STATE_CACHE_KEY,
|
||||
} from "./cache/restore-cache";
|
||||
import { cacheLocalPath, enableCache } from "./utils/inputs";
|
||||
import {
|
||||
cacheLocalPath,
|
||||
enableCache,
|
||||
pruneCache as shouldPruneCache,
|
||||
} from "./utils/inputs";
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
@@ -32,7 +36,9 @@ async function saveCache(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
await pruneCache();
|
||||
if (shouldPruneCache) {
|
||||
await pruneCache();
|
||||
}
|
||||
|
||||
core.info(`Saving cache path: ${cacheLocalPath}`);
|
||||
await cache.saveCache([cacheLocalPath], cacheKey);
|
||||
|
||||
Reference in New Issue
Block a user