Correctly handle multiline patterns for extracted entries (#393)

This commit is contained in:
Daz DeBoer 2024-09-14 16:00:48 -06:00 committed by GitHub
parent b4c01c399c
commit cf8c435260
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,7 +132,7 @@ abstract class AbstractEntryExtractor {
pattern: string, pattern: string,
listener: CacheEntryListener listener: CacheEntryListener
): Promise<ExtractedCacheEntry> { ): Promise<ExtractedCacheEntry> {
const restoredEntry = await restoreCache([pattern], cacheKey, [], listener) const restoredEntry = await restoreCache(pattern.split('\n'), cacheKey, [], listener)
if (restoredEntry) { if (restoredEntry) {
return new ExtractedCacheEntry(artifactType, pattern, cacheKey) return new ExtractedCacheEntry(artifactType, pattern, cacheKey)
} else { } else {
@ -231,7 +231,7 @@ abstract class AbstractEntryExtractor {
cacheDebug(`No change to previously restored ${artifactType}. Not saving.`) cacheDebug(`No change to previously restored ${artifactType}. Not saving.`)
entryListener.markNotSaved('contents unchanged') entryListener.markNotSaved('contents unchanged')
} else { } else {
await saveCache([pattern], cacheKey, entryListener) await saveCache(pattern.split('\n'), cacheKey, entryListener)
} }
for (const file of matchingFiles) { for (const file of matchingFiles) {