mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 07:03:17 +08:00
use on entry
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import fs from 'fs/promises'
|
||||
import {createWriteStream} from 'fs'
|
||||
import * as path from 'path'
|
||||
import * as github from '@actions/github'
|
||||
import * as core from '@actions/core'
|
||||
import * as httpClient from '@actions/http-client'
|
||||
@@ -89,7 +91,12 @@ export async function streamExtractExternal(
|
||||
clearTimeout(timer)
|
||||
reject(error)
|
||||
})
|
||||
.pipe(unzip.Extract({path: directory}))
|
||||
.pipe(unzip.Parse())
|
||||
.on('entry', (entry: unzip.Entry) => {
|
||||
const fullPath = path.normalize(path.join(directory, entry.path))
|
||||
core.debug(`Extracting artifact entry: ${fullPath}`)
|
||||
entry.pipe(createWriteStream(fullPath))
|
||||
})
|
||||
.on('close', () => {
|
||||
clearTimeout(timer)
|
||||
resolve()
|
||||
|
||||
Reference in New Issue
Block a user