Cleanups and package refactoring

This commit is contained in:
Bassem Dghaidi authored and GitHub committed 2024-10-24 05:19:48 -07:00
1 parent 224dfde884
commit 4af6ea76c2
7 files changed
+447 -20

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
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)
}