Files
toolkit/packages/cache/src/internal/blob/download-cache.ts
T

29 lines
667 B
TypeScript
Raw Normal View History

2024-06-17 01:17:10 -07:00
import * as core from '@actions/core'
import {
BlobClient,
BlockBlobClient,
2024-11-14 03:22:03 -08:00
BlobDownloadOptions
} from '@azure/storage-blob'
2024-06-17 01:17:10 -07:00
export async function DownloadCacheFile(
signedUploadURL: string,
2024-11-14 03:22:03 -08:00
archivePath: string
): Promise<{}> {
const downloadOptions: BlobDownloadOptions = {
2024-11-14 03:22:03 -08:00
maxRetryRequests: 5
}
2024-06-17 01:17:10 -07:00
const blobClient: BlobClient = new BlobClient(signedUploadURL)
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
2024-11-14 04:33:31 -08:00
core.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`)
2024-11-14 03:22:03 -08:00
return blockBlobClient.downloadToFile(
archivePath,
0,
undefined,
downloadOptions
)
}