mirror of
https://github.com/actions/toolkit.git
synced 2026-08-11 00:00:28 +02:00
Only mock the cacheUtil methods we need
This commit is contained in:
+10
-1
@@ -5,6 +5,7 @@ import {
|
||||
BlockBlobClient,
|
||||
BlockBlobParallelUploadOptions
|
||||
} from '@azure/storage-blob'
|
||||
import {InvalidResponseError} from '../shared/errors'
|
||||
|
||||
export async function uploadCacheFile(
|
||||
signedUploadURL: string,
|
||||
@@ -24,5 +25,13 @@ export async function uploadCacheFile(
|
||||
`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`
|
||||
)
|
||||
|
||||
return blockBlobClient.uploadFile(archivePath, uploadOptions)
|
||||
const resp = await blockBlobClient.uploadFile(archivePath, uploadOptions)
|
||||
|
||||
if (resp._response.status >= 400) {
|
||||
throw new InvalidResponseError(
|
||||
`Upload failed with status code: ${resp._response.status}`
|
||||
)
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user