only pre-clean when something was restored
This commit is contained in:
parent
292ef23e77
commit
9de90d2338
|
@ -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}`);
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue