1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-10 00:53:10 +00:00

replace unzipper with unzip-stream

This commit is contained in:
Rob Herley 2023-12-11 12:15:40 -05:00
parent 950e1711a1
commit 3c3af56b29
No known key found for this signature in database
GPG key ID: D1602042C3543B06
3 changed files with 28 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import fs from 'fs/promises'
import * as github from '@actions/github'
import * as core from '@actions/core'
import * as httpClient from '@actions/http-client'
import unzipper from 'unzipper'
import unzip from 'unzip-stream'
import {
DownloadArtifactOptions,
DownloadArtifactResponse
@ -47,7 +47,12 @@ async function streamExtract(url: string, directory: string): Promise<void> {
)
}
return response.message.pipe(unzipper.Extract({path: directory})).promise()
return new Promise((resolve, reject) => {
response.message
.pipe(unzip.Extract({path: directory}))
.on('close', resolve)
.on('error', reject)
})
}
export async function downloadArtifactPublic(