mirror of
https://github.com/actions/toolkit.git
synced 2026-08-13 00:00:44 +02:00
25 lines
747 B
TypeScript
25 lines
747 B
TypeScript
import * as core from '@actions/core'
|
|
|
|
import {
|
|
BlobClient,
|
|
BlockBlobClient,
|
|
BlobDownloadOptions,
|
|
} from '@azure/storage-blob'
|
|
|
|
export async function DownloadCacheFile(
|
|
signedUploadURL: string,
|
|
archivePath: string,
|
|
): Promise<{}> {
|
|
const downloadOptions: BlobDownloadOptions = {
|
|
maxRetryRequests: 5,
|
|
}
|
|
|
|
// TODO: tighten the configuration and pass the appropriate user-agent
|
|
const blobClient: BlobClient = new BlobClient(signedUploadURL)
|
|
const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient()
|
|
|
|
core.debug(`BlobClient: ${JSON.stringify(blobClient)}`)
|
|
core.debug(`blockBlobClient: ${JSON.stringify(blockBlobClient)}`)
|
|
|
|
return blockBlobClient.downloadToFile(archivePath, 0, undefined, downloadOptions)
|
|
} |