Improve cache key info logging for restore key

This commit is contained in:
Albert Still 2021-03-26 10:39:18 +11:00
parent 4134e6de47
commit 1eade9d5b9
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}); });

View file

@ -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;