From dccc3f7f1cd4f7b126b46b48efb4ee368bc80173 Mon Sep 17 00:00:00 2001 From: Bassem Dghaidi <568794+Link-@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:01:01 -0700 Subject: [PATCH] Fix upload mechanics --- packages/cache/src/internal/v2/upload/upload-cache.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cache/src/internal/v2/upload/upload-cache.ts b/packages/cache/src/internal/v2/upload/upload-cache.ts index d709671f..54616fb2 100644 --- a/packages/cache/src/internal/v2/upload/upload-cache.ts +++ b/packages/cache/src/internal/v2/upload/upload-cache.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core' import {GetCacheBlobUploadURLResponse} from '../../../generated/results/api/v1/blobcache' -import {BlobClient, BlockBlobParallelUploadOptions} from '@azure/storage-blob' +import {BlobClient, BlockBlobClient, BlockBlobParallelUploadOptions} from '@azure/storage-blob' export async function UploadCache( uploadURL: GetCacheBlobUploadURLResponse, @@ -16,7 +16,9 @@ export async function UploadCache( }; // Create blob client from container client - const blobClient: BlobClient = new BlobClient(uploadURL.urls[0]) + // const blobClient: BlobClient = new BlobClient(uploadURL.urls[0]) + const blobClient: BlobClient = new BlobClient(uploadURL.urls[0].url) + const blockBlobClient: BlockBlobClient = blobClient.getBlockBlobClient() - return blobClient.uploadFile(archivePath, uploadOptions); + return blockBlobClient.uploadFile(archivePath, uploadOptions); } \ No newline at end of file