mirror of
https://github.com/Swatinem/rust-cache
synced 2026-09-07 20:03:24 +00:00
only pre-clean when something was restored
This commit is contained in:
Vendored
+5
-5
@@ -54800,15 +54800,15 @@ async function run() {
|
||||
if (restoreKey) {
|
||||
core.info(`Restored from cache key "${restoreKey}".`);
|
||||
core.saveState(stateKey, restoreKey);
|
||||
if (restoreKey !== key) {
|
||||
// pre-clean the target directory on cache mismatch
|
||||
const packages = await getPackages();
|
||||
await cleanTarget(packages);
|
||||
}
|
||||
}
|
||||
else {
|
||||
core.info("No cache found.");
|
||||
}
|
||||
if (restoreKey !== key) {
|
||||
// pre-clean the target directory on cache mismatch
|
||||
const packages = await getPackages();
|
||||
await cleanTarget(packages);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
core.info(`[warning] ${e.message}`);
|
||||
|
||||
+7
-7
@@ -20,16 +20,16 @@ async function run() {
|
||||
if (restoreKey) {
|
||||
core.info(`Restored from cache key "${restoreKey}".`);
|
||||
core.saveState(stateKey, restoreKey);
|
||||
|
||||
if (restoreKey !== key) {
|
||||
// pre-clean the target directory on cache mismatch
|
||||
const packages = await getPackages();
|
||||
|
||||
await cleanTarget(packages);
|
||||
}
|
||||
} else {
|
||||
core.info("No cache found.");
|
||||
}
|
||||
|
||||
if (restoreKey !== key) {
|
||||
// pre-clean the target directory on cache mismatch
|
||||
const packages = await getPackages();
|
||||
|
||||
await cleanTarget(packages);
|
||||
}
|
||||
} catch (e) {
|
||||
core.info(`[warning] ${e.message}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user