Add fix cache paths

This commit is contained in:
Bassem Dghaidi authored and GitHub committed 2024-06-17 03:36:06 -07:00
1 parent 0fb32f1fdb
commit a3ecc360ef
2 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -223,8 +223,9 @@ async function restoreCachev2(
return undefined
}
core.info(`Cache hit for: ${signedDownloadURL.blobs[0].key}`)
core.info(`Starting download of artifact to: ${paths[0]}`)
await StreamExtract(signedDownloadURL.blobs[0].signedUrl, paths[0])
await StreamExtract(signedDownloadURL.blobs[0].signedUrl, path.dirname(paths[0]))
core.info(`Artifact download completed successfully.`)
return keys[0]
+3 -2
View File
@@ -11,7 +11,7 @@ export async function StreamExtract(url: string, directory: string): Promise<voi
return
} catch (error) {
retryCount++
core.debug(
core.info(
`Failed to download cache after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`
)
// wait 5 seconds before retrying
@@ -29,6 +29,7 @@ export async function streamExtractExternal(
const client = new httpClient.HttpClient(`@actions/cache-${packageJson.version}`)
const response = await client.get(url)
if (response.message.statusCode !== 200) {
core.info(`Failed to download cache. HTTP status code: ${response.message.statusCode}`)
throw new Error(
`Unexpected HTTP response from blob storage: ${response.message.statusCode} ${response.message.statusMessage}`
)
@@ -49,7 +50,7 @@ export async function streamExtractExternal(
timer.refresh()
})
.on('error', (error: Error) => {
core.debug(
core.info(
`response.message: Cache download failed: ${error.message}`
)
clearTimeout(timer)