1
0
Fork 0
pull/1700/head
Vallie Joseph 2024-04-01 13:58:57 +00:00
parent 90ee020ccd
commit 2da528819c
5 changed files with 9 additions and 9 deletions

View File

@ -19,7 +19,6 @@
"@octokit/request-error": "^5.0.0", "@octokit/request-error": "^5.0.0",
"@protobuf-ts/plugin": "^2.2.3-alpha.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"async": "^3.2.5",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"twirp-ts": "^2.5.0", "twirp-ts": "^2.5.0",

View File

@ -50,7 +50,6 @@
"@octokit/request-error": "^5.0.0", "@octokit/request-error": "^5.0.0",
"@protobuf-ts/plugin": "^2.2.3-alpha.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"async": "^3.2.5",
"crypto": "^1.0.1", "crypto": "^1.0.1",
"jwt-decode": "^3.1.2", "jwt-decode": "^3.1.2",
"twirp-ts": "^2.5.0", "twirp-ts": "^2.5.0",

View File

@ -52,6 +52,7 @@ export async function uploadZipToBlobStorage(
zipUploadStream.pipe(hashStream).setEncoding('hex') // This stream is used to compute a hash of the zip content that gets used. Integrity check zipUploadStream.pipe(hashStream).setEncoding('hex') // This stream is used to compute a hash of the zip content that gets used. Integrity check
core.info('Beginning upload of artifact content to blob storage') core.info('Beginning upload of artifact content to blob storage')
try { try {
await blockBlobClient.uploadStream( await blockBlobClient.uploadStream(
uploadStream, uploadStream,

View File

@ -72,6 +72,7 @@ export async function uploadArtifact(
zipSpecification, zipSpecification,
options?.compressionLevel options?.compressionLevel
) )
// Upload zip to blob storage // Upload zip to blob storage
const uploadResult = await uploadZipToBlobStorage( const uploadResult = await uploadZipToBlobStorage(
createArtifactResp.signedUploadUrl, createArtifactResp.signedUploadUrl,

View File

@ -39,9 +39,9 @@ export async function createZipUploadStream(
// register callbacks for various events during the zip lifecycle // register callbacks for various events during the zip lifecycle
zip.on('error', zipErrorCallback) zip.on('error', zipErrorCallback)
zip.on('warning', zipWarningCallback) zip.on('warning', zipWarningCallback)
zip.on('finish', zipFinishCallback) zip.on('finish', zipFinishCallback)
zip.on('end', zipEndCallback) zip.on('end', zipEndCallback)
for (const file of uploadSpecification) { for (const file of uploadSpecification) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
if (file.sourcePath !== null) { if (file.sourcePath !== null) {
@ -91,17 +91,17 @@ const zipErrorCallback = (error: any): void => {
throw new Error('An error has occurred during zip creation for the artifact') throw new Error('An error has occurred during zip creation for the artifact')
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
const zipWarningCallback = (err: any): void => { const zipWarningCallback = (error: any): void => {
if (err.code === 'ENOENT') { if (error.code === 'ENOENT') {
core.warning( core.warning(
'ENOENT warning during artifact zip creation. No such file or directory' 'ENOENT warning during artifact zip creation. No such file or directory'
) )
core.info(err) core.info(error)
} else { } else {
core.warning( core.warning(
`A non-blocking warning has occurred during artifact zip creation: ${err.code}` `A non-blocking warning has occurred during artifact zip creation: ${error.code}`
) )
core.info(err) core.info(error)
} }
} }