mirror of https://github.com/actions/toolkit
cleaning up warning callack
parent
06482c6da1
commit
d97edf7f61
|
@ -26,9 +26,9 @@ export async function createZipUploadStream(
|
||||||
uploadSpecification: UploadZipSpecification[],
|
uploadSpecification: UploadZipSpecification[],
|
||||||
compressionLevel: number = DEFAULT_COMPRESSION_LEVEL
|
compressionLevel: number = DEFAULT_COMPRESSION_LEVEL
|
||||||
): Promise<ZipUploadStream> {
|
): Promise<ZipUploadStream> {
|
||||||
// core.debug(
|
core.debug(
|
||||||
// `Creating Artifact archive with compressionLevel: ${compressionLevel}`
|
`Creating Artifact archive with compressionLevel: ${compressionLevel}`
|
||||||
// )
|
)
|
||||||
const zlibOptions = {
|
const zlibOptions = {
|
||||||
zlib: {level: compressionLevel, bufferSize: getUploadChunkSize()}
|
zlib: {level: compressionLevel, bufferSize: getUploadChunkSize()}
|
||||||
}
|
}
|
||||||
|
@ -42,19 +42,7 @@ export async function createZipUploadStream(
|
||||||
'An error has occurred during zip creation for the artifact'
|
'An error has occurred during zip creation for the artifact'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
zip.on('warning', err => {
|
zip.on('warning', zipWarningCallback)
|
||||||
if (err.code === 'ENOENT') {
|
|
||||||
core.warning(
|
|
||||||
'ENOENT warning during artifact zip creation. No such file or directory'
|
|
||||||
)
|
|
||||||
core.info(err)
|
|
||||||
} else {
|
|
||||||
core.warning(
|
|
||||||
`A non-blocking warning has occurred during artifact zip creation: ${err.code}`
|
|
||||||
)
|
|
||||||
core.info(err)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
zip.on('finish', () => {
|
zip.on('finish', () => {
|
||||||
core.debug('Zip stream for upload has finished.')
|
core.debug('Zip stream for upload has finished.')
|
||||||
|
@ -106,21 +94,19 @@ export async function createZipUploadStream(
|
||||||
|
|
||||||
// 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')
|
||||||
// }
|
// }
|
||||||
|
const zipWarningCallback = (err: any): void => {
|
||||||
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
if (err.code === 'ENOENT') {
|
||||||
// const zipWarningCallback = (error: any): void => {
|
core.warning(
|
||||||
// if (error.code === 'ENOENT') {
|
'ENOENT warning during artifact zip creation. No such file or directory'
|
||||||
// core.warning(
|
)
|
||||||
// 'ENOENT warning during artifact zip creation. No such file or directory'
|
core.info(err)
|
||||||
// )
|
} else {
|
||||||
// core.info(error)
|
core.warning(
|
||||||
// } else {
|
`A non-blocking warning has occurred during artifact zip creation: ${err.code}`
|
||||||
// core.warning(
|
)
|
||||||
// `A non-blocking warning has occurred during artifact zip creation: ${error.code}`
|
core.info(err)
|
||||||
// )
|
}
|
||||||
// core.info(error)
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const zipFinishCallback = (): void => {
|
// const zipFinishCallback = (): void => {
|
||||||
// core.debug('Zip stream for upload has finished.')
|
// core.debug('Zip stream for upload has finished.')
|
||||||
|
|
Loading…
Reference in New Issue