diff --git a/src/cache-extract-entries.ts b/src/cache-extract-entries.ts index 68e455b..deac72e 100644 --- a/src/cache-extract-entries.ts +++ b/src/cache-extract-entries.ts @@ -393,7 +393,7 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor { if (cacheEntries.length > 0) { core.info(`Not restoring configuration-cache state, as ${reason}`) for (const cacheEntry of cacheEntries) { - listener.entry(cacheEntry.pattern).markNotRestored(reason).markNotSaved(reason) + listener.entry(cacheEntry.pattern).markNotRestored(reason) } // Update the results file based on no entries restored @@ -403,9 +403,12 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor { async extract(listener: CacheListener): Promise { if (!params.getCacheEncryptionKey()) { - core.info('Not saving configuration-cache state, as no encryption key was provided') - for (const cacheEntry of this.getExtractedCacheEntryDefinitions()) { - listener.entry(cacheEntry.pattern).markNotSaved('No encryption key provided') + const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions() + if (cacheEntryDefinitions.length > 0) { + core.info('Not saving configuration-cache state, as no encryption key was provided') + for (const cacheEntry of cacheEntryDefinitions) { + listener.entry(cacheEntry.pattern).markNotSaved('No encryption key provided') + } } return } diff --git a/src/cache-reporting.ts b/src/cache-reporting.ts index 11d5fd2..0a90800 100644 --- a/src/cache-reporting.ts +++ b/src/cache-reporting.ts @@ -198,6 +198,9 @@ function getSavedMessage(entry: CacheEntryListener, cacheReadOnly: boolean): str if (cacheReadOnly) { return '(Entry not saved: cache is read-only)' } + if (entry.notRestored) { + return '(Entry not saved: not restored)' + } return '(Entry not saved: reason unknown)' } if (entry.savedSize === 0) {