Skip to content

Commit

Permalink
updating resolves
Browse files Browse the repository at this point in the history
  • Loading branch information
vmjoseph committed Mar 28, 2024
1 parent 66343fa commit c7de68f
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions packages/artifact/src/internal/upload/zip.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as stream from 'stream'
import * as async from 'async'
import * as ZipStream from 'zip-stream'
import * as core from '@actions/core'
import {createReadStream} from 'fs'
Expand Down Expand Up @@ -60,18 +59,21 @@ export async function createZipUploadStream(
})
})

const bufferSize = getUploadChunkSize()
const zipUploadStream = new ZipUploadStream(bufferSize)
core.debug(
`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
)
core.debug(
`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
)
await Promise.all(uploadFilePromises)
await Promise.all(uploadFilePromises).then(result => {
core.debug(`Zip result is ${result}`)
zip.finalize()
const bufferSize = getUploadChunkSize()
const zipUploadStream = new ZipUploadStream(bufferSize)
core.debug(
`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
)
core.debug(
`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
)
return zipUploadStream
})
throw new Error('An error has occurred during zip creation for the artifact')
// zip.pipe(zipUploadStream)
zip.finalize()
return zipUploadStream
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -81,6 +83,7 @@ const zipErrorCallback = (error: any): void => {

throw new Error('An error has occurred during zip creation for the artifact')
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const zipWarningCallback = (err: any): void => {
if (err.code === 'ENOENT') {
core.warning(
Expand Down

0 comments on commit c7de68f

Please sign in to comment.