Fixes #357 Use a read stream for artifacts.
Some checks failed
Test / check_pr (push) Has been cancelled
Some checks failed
Test / check_pr (push) Has been cancelled
This seems to be safe since octokit mentions ReadableStreams in their fetcher wrapper & tests: https://github.com/octokit/request.js/blob/main/src/fetch-wrapper.ts#L44 (and also it seems to work when I test it).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { basename } from "path";
|
||||
import { readFileSync, statSync } from "fs";
|
||||
import {createReadStream, readFileSync, ReadStream, statSync} from "fs";
|
||||
|
||||
export class Artifact {
|
||||
readonly contentType: string
|
||||
@@ -16,7 +16,7 @@ export class Artifact {
|
||||
return statSync(this.path).size
|
||||
}
|
||||
|
||||
readFile(): Buffer {
|
||||
return readFileSync(this.path)
|
||||
readFile(): ReadStream {
|
||||
return createReadStream(this.path)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user