mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Only mock the cacheUtil methods we need
This commit is contained in:
11
packages/cache/src/internal/blob/upload-cache.ts
vendored
11
packages/cache/src/internal/blob/upload-cache.ts
vendored
@@ -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