diff --git a/packages/artifact/src/internal/download/download-artifact.ts b/packages/artifact/src/internal/download/download-artifact.ts index bc64d51d..6ff72a02 100644 --- a/packages/artifact/src/internal/download/download-artifact.ts +++ b/packages/artifact/src/internal/download/download-artifact.ts @@ -50,10 +50,11 @@ async function streamExtract(url: string, directory: string): Promise { return new Promise((resolve, reject) => { response.readableStreamBody - ?.pipe(unzip.Extract({path: directory})) - .on('close', resolve) - .on('error', reject) + ?.on('error', reject) .on('aborted', reject) + .pipe(unzip.Extract({path: directory})) + .on('error', reject) + .on('close', resolve) }) }