mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 02:44:20 +00:00
use fs.createReadStream instead of readFileSync
This commit is contained in:
parent
cd28b0f5ee
commit
ceb4b9ba8c
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import { GitHub } from "@actions/github/lib/utils";
|
import { GitHub } from "@actions/github/lib/utils";
|
||||||
import { Config, isTag, releaseBody } from "./util";
|
import { Config, isTag, releaseBody } from "./util";
|
||||||
import { statSync, readFileSync } from "fs";
|
import { statSync, createReadStream } from "fs";
|
||||||
import { getType } from "mime";
|
import { getType } from "mime";
|
||||||
import { basename } from "path";
|
import { basename } from "path";
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ export interface ReleaseAsset {
|
||||||
name: string;
|
name: string;
|
||||||
mime: string;
|
mime: string;
|
||||||
size: number;
|
size: number;
|
||||||
data: Buffer;
|
data: NodeJS.ReadableStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Release {
|
export interface Release {
|
||||||
|
@ -128,7 +128,7 @@ export const asset = (path: string): ReleaseAsset => {
|
||||||
name: basename(path),
|
name: basename(path),
|
||||||
mime: mimeOrDefault(path),
|
mime: mimeOrDefault(path),
|
||||||
size: statSync(path).size,
|
size: statSync(path).size,
|
||||||
data: readFileSync(path)
|
data: createReadStream(path)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue