mirror of https://github.com/actions/toolkit
Revert Address review comments
parent
d79a09bc0e
commit
27f9a7d461
|
@ -97,12 +97,22 @@ export async function restoreCache(
|
|||
compressionMethod
|
||||
})
|
||||
} catch (error) {
|
||||
cacheEntry = await cacheHttpClient.getCacheEntryForGzipFallbackOnWindows(
|
||||
keys,
|
||||
paths,
|
||||
compressionMethod,
|
||||
error
|
||||
)
|
||||
// This is to support the old cache entry created
|
||||
// by the old version of the cache action on windows.
|
||||
if (
|
||||
process.platform === 'win32' &&
|
||||
compressionMethod !== CompressionMethod.Gzip
|
||||
) {
|
||||
compressionMethod = CompressionMethod.Gzip
|
||||
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
|
||||
compressionMethod
|
||||
})
|
||||
if (!cacheEntry?.archiveLocation) {
|
||||
throw error
|
||||
}
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
if (!cacheEntry?.archiveLocation) {
|
||||
|
|
|
@ -122,32 +122,6 @@ export async function getCacheEntry(
|
|||
return cacheResult
|
||||
}
|
||||
|
||||
// This is to support the old cache entry created
|
||||
// by the old version of the cache action on windows.
|
||||
export async function getCacheEntryForGzipFallbackOnWindows(
|
||||
keys: string[],
|
||||
paths: string[],
|
||||
compressionMethod: CompressionMethod,
|
||||
error: unknown
|
||||
): Promise<ArtifactCacheEntry> {
|
||||
let cacheEntry: ArtifactCacheEntry | null
|
||||
if (
|
||||
process.platform === 'win32' &&
|
||||
compressionMethod !== CompressionMethod.Gzip
|
||||
) {
|
||||
compressionMethod = CompressionMethod.Gzip
|
||||
cacheEntry = await getCacheEntry(keys, paths, {
|
||||
compressionMethod
|
||||
})
|
||||
if (!cacheEntry?.archiveLocation) {
|
||||
throw error
|
||||
}
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
return cacheEntry
|
||||
}
|
||||
|
||||
export async function downloadCache(
|
||||
archiveLocation: string,
|
||||
archivePath: string,
|
||||
|
|
Loading…
Reference in New Issue