mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 03:04:01 +00:00 
			
		
		
		
	Improve cache key info logging for restore key
This commit is contained in:
		
							parent
							
								
									4134e6de47
								
							
						
					
					
						commit
						1eade9d5b9
					
				@ -304,7 +304,7 @@ test("restore with cache found for restore key", async () => {
 | 
				
			|||||||
    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    expect(infoMock).toHaveBeenCalledWith(
 | 
					    expect(infoMock).toHaveBeenCalledWith(
 | 
				
			||||||
        `Cache restored from key: ${restoreKey}`
 | 
					        `Cache restored from restore key: ${restoreKey}`
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
@ -52,7 +52,7 @@ async function run(): Promise<void> {
 | 
				
			|||||||
            const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
 | 
					            const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
 | 
				
			||||||
            utils.setCacheHitOutput(isExactKeyMatch);
 | 
					            utils.setCacheHitOutput(isExactKeyMatch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            core.info(`Cache restored from key: ${cacheKey}`);
 | 
					            core.info(`Cache restored from ${isExactKeyMatch ? '' : 'restore '}key: ${cacheKey}`);
 | 
				
			||||||
        } catch (error) {
 | 
					        } catch (error) {
 | 
				
			||||||
            if (error.name === cache.ValidationError.name) {
 | 
					            if (error.name === cache.ValidationError.name) {
 | 
				
			||||||
                throw error;
 | 
					                throw error;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user