1
0
Fork 0

replace unzipper with unzip-stream

pull/1602/head
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

@ -18,11 +18,13 @@
"@octokit/plugin-retry": "^3.0.9", "@octokit/plugin-retry": "^3.0.9",
"@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",
"@types/unzip-stream": "^0.3.4",
"@types/unzipper": "^0.10.6", "@types/unzipper": "^0.10.6",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"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",
"unzip-stream": "^0.3.1",
"unzipper": "^0.10.14" "unzipper": "^0.10.14"
}, },
"devDependencies": { "devDependencies": {
@ -471,6 +473,14 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/unzip-stream": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/@types/unzip-stream/-/unzip-stream-0.3.4.tgz",
"integrity": "sha512-ud0vtsNRF+joUCyvNMyo0j5DKX2Lh/im+xVgRzBEsfHhQYZ+i4fKTveova9XxLzt6Jl6G0e/0mM4aC0gqZYSnA==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/unzipper": { "node_modules/@types/unzipper": {
"version": "0.10.6", "version": "0.10.6",
"resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz", "resolved": "https://registry.npmjs.org/@types/unzipper/-/unzipper-0.10.6.tgz",
@ -1513,6 +1523,15 @@
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
}, },
"node_modules/unzip-stream": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.1.tgz",
"integrity": "sha512-RzaGXLNt+CW+T41h1zl6pGz3EaeVhYlK+rdAap+7DxW5kqsqePO8kRtWPaCiVqdhZc86EctSPVYNix30YOMzmw==",
"dependencies": {
"binary": "^0.3.0",
"mkdirp": "^0.5.1"
}
},
"node_modules/unzipper": { "node_modules/unzipper": {
"version": "0.10.14", "version": "0.10.14",
"resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz", "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.14.tgz",

View File

@ -49,11 +49,13 @@
"@octokit/plugin-retry": "^3.0.9", "@octokit/plugin-retry": "^3.0.9",
"@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",
"@types/unzip-stream": "^0.3.4",
"@types/unzipper": "^0.10.6", "@types/unzipper": "^0.10.6",
"archiver": "^5.3.1", "archiver": "^5.3.1",
"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",
"unzip-stream": "^0.3.1",
"unzipper": "^0.10.14" "unzipper": "^0.10.14"
}, },
"devDependencies": { "devDependencies": {

View File

@ -2,7 +2,7 @@ import fs from 'fs/promises'
import * as github from '@actions/github' import * as github from '@actions/github'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as httpClient from '@actions/http-client' import * as httpClient from '@actions/http-client'
import unzipper from 'unzipper' import unzip from 'unzip-stream'
import { import {
DownloadArtifactOptions, DownloadArtifactOptions,
DownloadArtifactResponse 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( export async function downloadArtifactPublic(