mirror of https://github.com/actions/cache.git
				
				
				
			updated restore
This commit is contained in:
		
							parent
							
								
									0756d0f6e9
								
							
						
					
					
						commit
						2b724dd191
					
				| 
						 | 
					@ -48997,8 +48997,7 @@ function run() {
 | 
				
			||||||
            const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
 | 
					            const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
 | 
				
			||||||
            utils.setCacheHitOutput(isExactKeyMatch);
 | 
					            utils.setCacheHitOutput(isExactKeyMatch);
 | 
				
			||||||
            if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") {
 | 
					            if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") {
 | 
				
			||||||
                core.info("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true");
 | 
					                throw new Error("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true");
 | 
				
			||||||
                return;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            core.info(`Cache restored from key: ${cacheKey}`);
 | 
					            core.info(`Cache restored from key: ${cacheKey}`);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,10 +53,9 @@ async function run(): Promise<void> {
 | 
				
			||||||
        utils.setCacheHitOutput(isExactKeyMatch);
 | 
					        utils.setCacheHitOutput(isExactKeyMatch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") {
 | 
					        if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") {
 | 
				
			||||||
            core.info(
 | 
					            throw new Error(
 | 
				
			||||||
                "Cache with exact key not found, hence exiting the workflow as strict-restore is set to true"
 | 
					                "Cache with exact key not found, hence exiting the workflow as strict-restore is set to true"
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            return;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        core.info(`Cache restored from key: ${cacheKey}`);
 | 
					        core.info(`Cache restored from key: ${cacheKey}`);
 | 
				
			||||||
    } catch (error: unknown) {
 | 
					    } catch (error: unknown) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue