|
|
@ -17,12 +17,16 @@ async function run() {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
core.debug(`Cache Path: ${cachePath}`);
|
|
|
|
core.debug(`Cache Path: ${cachePath}`);
|
|
|
|
|
|
|
|
|
|
|
|
const primaryKey = core.getInput(Inputs.Key, { required: true });
|
|
|
|
const keys = [
|
|
|
|
|
|
|
|
core.getInput(Inputs.Key, { required: true }),
|
|
|
|
|
|
|
|
...core
|
|
|
|
|
|
|
|
.getInput(Inputs.RestoreKeys)
|
|
|
|
|
|
|
|
.split(/\s*\n\s*/)
|
|
|
|
|
|
|
|
.filter(x => x)
|
|
|
|
|
|
|
|
].map(key => encodeURIComponent(key).replace(/%/g, " "));
|
|
|
|
|
|
|
|
const primaryKey = keys[0];
|
|
|
|
core.saveState(State.CacheKey, primaryKey);
|
|
|
|
core.saveState(State.CacheKey, primaryKey);
|
|
|
|
|
|
|
|
|
|
|
|
const restoreKeys = core.getInput(Inputs.RestoreKeys).split("\n");
|
|
|
|
|
|
|
|
const keys = [primaryKey, ...restoreKeys];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
core.debug("Resolved Keys:");
|
|
|
|
core.debug("Resolved Keys:");
|
|
|
|
core.debug(JSON.stringify(keys));
|
|
|
|
core.debug(JSON.stringify(keys));
|
|
|
|
|
|
|
|
|
|
|
@ -39,13 +43,6 @@ async function run() {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const regex = /^[^,]*$/;
|
|
|
|
|
|
|
|
if (!regex.test(key)) {
|
|
|
|
|
|
|
|
core.setFailed(
|
|
|
|
|
|
|
|
`Key Validation Error: ${key} cannot contain commas.`
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|