mirror of
https://github.com/actions/cache.git
synced 2025-07-17 12:25:15 -06:00
Allow updating cache with 'update' key
This commit is contained in:
parent
eed9cfe64d
commit
2d697b4d9c
6 changed files with 62 additions and 4 deletions
|
@ -16,15 +16,17 @@ 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
|
||||
// Inputs are re-evaluated before the post action, so we want the original key used for restore
|
||||
const primaryKey = core.getState(State.CachePrimaryKey);
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Error retrieving key from state.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (utils.isExactKeyMatch(primaryKey, state)) {
|
||||
if (
|
||||
utils.isExactKeyMatch(primaryKey, state) &&
|
||||
!utils.getInputAsBoolean(Inputs.Update)
|
||||
) {
|
||||
core.info(
|
||||
`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue