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:
parent
78b8f18c17
commit
226c25a2b7
2 changed files with 31 additions and 8 deletions
11
src/save.ts
11
src/save.ts
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue