mirror of https://github.com/actions/toolkit
Merge pull request #1771 from rmunn/fix-too-many-open-files
Prevent "too many open files" in artifact uploadpull/1781/head
commit
7463cf3da6
|
@ -1,7 +1,6 @@
|
||||||
import * as stream from 'stream'
|
import * as stream from 'stream'
|
||||||
import * as archiver from 'archiver'
|
import * as archiver from 'archiver'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {createReadStream} from 'fs'
|
|
||||||
import {UploadZipSpecification} from './upload-zip-specification'
|
import {UploadZipSpecification} from './upload-zip-specification'
|
||||||
import {getUploadChunkSize} from '../shared/config'
|
import {getUploadChunkSize} from '../shared/config'
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ export async function createZipUploadStream(
|
||||||
for (const file of uploadSpecification) {
|
for (const file of uploadSpecification) {
|
||||||
if (file.sourcePath !== null) {
|
if (file.sourcePath !== null) {
|
||||||
// Add a normal file to the zip
|
// Add a normal file to the zip
|
||||||
zip.append(createReadStream(file.sourcePath), {
|
zip.file(file.sourcePath, {
|
||||||
name: file.destinationPath
|
name: file.destinationPath
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue