mirror of
https://github.com/actions/toolkit
synced 2025-05-10 09:03:02 +00:00
Delete download-cache
This commit is contained in:
parent
3a128c88c3
commit
c5a5de05f6
1 changed files with 0 additions and 45 deletions
|
@ -1,45 +0,0 @@
|
||||||
import * as core from '@actions/core'
|
|
||||||
|
|
||||||
import {
|
|
||||||
BlobClient,
|
|
||||||
BlockBlobClient,
|
|
||||||
BlobDownloadOptions,
|
|
||||||
BlobDownloadResponseParsed
|
|
||||||
} from '@azure/storage-blob'
|
|
||||||
|
|
||||||
export async function downloadCacheFile(
|
|
||||||
signedUploadURL: string,
|
|
||||||
archivePath: string
|
|
||||||
): Promise<BlobDownloadResponseParsed> {
|
|
||||||
const downloadOptions: BlobDownloadOptions = {
|
|
||||||
maxRetryRequests: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
const blobClient: BlobClient = new BlobClient(signedUploadURL)
|
|
||||||
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
|
|
||||||
|
|
||||||
core.debug(
|
|
||||||
`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`
|
|
||||||
)
|
|
||||||
|
|
||||||
const response = await blockBlobClient.downloadToFile(
|
|
||||||
archivePath,
|
|
||||||
0,
|
|
||||||
undefined,
|
|
||||||
downloadOptions
|
|
||||||
)
|
|
||||||
|
|
||||||
switch (response._response.status) {
|
|
||||||
case 200:
|
|
||||||
core.info(`Cache downloaded from "${signedUploadURL}"`)
|
|
||||||
break
|
|
||||||
case 304:
|
|
||||||
core.info(`Cache not found at "${signedUploadURL}"`)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
core.info(`Unexpected HTTP response: ${response._response.status}`)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
return response
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue