|
|
|
@ -8,7 +8,6 @@ import {
|
|
|
|
|
StateProvider
|
|
|
|
|
} from "./stateProvider";
|
|
|
|
|
import * as utils from "./utils/actionUtils";
|
|
|
|
|
import { issueCommand } from "@actions/core/lib/command";
|
|
|
|
|
|
|
|
|
|
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
|
|
|
|
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
|
|
|
@ -51,13 +50,16 @@ export async function saveImpl(
|
|
|
|
|
const forceOverwrite = utils.getInputAsBool(Inputs.ForceOverwrite);
|
|
|
|
|
if (utils.isExactKeyMatch(primaryKey, restoredKey) && !forceOverwrite) {
|
|
|
|
|
core.info(
|
|
|
|
|
`Cache hit occurred on the primary key ${primaryKey} and force-overwrite is disabled, not saving cache.`
|
|
|
|
|
`Cache hit occurred on the primary key "${primaryKey}" and force-overwrite is disabled, not saving cache.`
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (utils.isExactKeyMatch(primaryKey, restoredKey) && forceOverwrite) {
|
|
|
|
|
await issueCommand('actions-cache delete', {}, primaryKey);
|
|
|
|
|
if ((restoredKey == undefined || utils.isExactKeyMatch(primaryKey, restoredKey)) && forceOverwrite) {
|
|
|
|
|
core.info(
|
|
|
|
|
`Cache hit occurred on the primary key "${primaryKey}" or running as save-only and force-overwrite is enabled, deleting cache.`
|
|
|
|
|
);
|
|
|
|
|
await cache.deleteCache(primaryKey)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cachePaths = utils.getInputAsArray(Inputs.Path, {
|
|
|
|
|