diff --git a/src/restore.ts b/src/restore.ts index 1dad4c36..6d1272c8 100644 --- a/src/restore.ts +++ b/src/restore.ts @@ -19,9 +19,9 @@ async function restore(ccacheVariant : string) : Promise { restoreKeys: core.getInput("restore-keys").split("\n").map(s => s.trim()).filter(x => x !== "") }; - const keyPrefix = ccacheVariant + "-"; - const primaryKey = inputs.primaryKey ? keyPrefix + inputs.primaryKey + "-" : keyPrefix; - const restoreKeys = inputs.restoreKeys.map(k => keyPrefix + k + "-") + const keyPrefix = ccacheVariant; + const primaryKey = inputs.primaryKey ? keyPrefix + "-" + inputs.primaryKey : keyPrefix; + const restoreKeys = inputs.restoreKeys.map(k => keyPrefix + "-" + k) const paths = [`.${ccacheVariant}`]; core.saveState("primaryKey", primaryKey); diff --git a/src/save.ts b/src/save.ts index 22539b02..07be083c 100644 --- a/src/save.ts +++ b/src/save.ts @@ -62,7 +62,7 @@ async function run() : Promise { } else { let saveKey = primaryKey; if (core.getState("appendTimestamp") == "true") { - saveKey += new Date().toISOString(); + saveKey += "-" + new Date().toISOString(); } else { core.debug("Not appending timestamp because 'append-timestamp' is not set to 'true'."); }