1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-05-04 09:19:55 +02:00

add primary key reevaluation boolean logic & jobs to Tests workflow

This commit is contained in:
Vincent Clemson 2022-06-19 00:48:07 -04:00
parent 78b8f18c17
commit 226c25a2b7
2 changed files with 31 additions and 8 deletions

View file

@ -28,8 +28,15 @@ async function run(): Promise<void> {
const state = utils.getCacheState();
// Inputs are re-evaluted before the post action, so we want the original key used for restore
const primaryKey = core.getState(State.CachePrimaryKey);
let primaryKey: string = '';
const reeval = core.getBooleanInput(Inputs.Reeval);
if (!reeval) {
// Inputs are reevaluted before the post action, so we want the original key used for restore
primaryKey = core.getState(State.CachePrimaryKey);
} else {
// choose to reevaluate primary key
primaryKey = core.getInput(Inputs.Key, { required: true });
}
if (!primaryKey) {
utils.logWarning(`Error retrieving key from state.`);
return;