mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-27 22:06:03 +00:00
Revert "fix: fix file closing issue (#629)"
This reverts commit 07a2257003
.
This commit is contained in:
parent
f3cad8bcbf
commit
eaae3e764f
3 changed files with 4 additions and 8 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -180,7 +180,6 @@ export const upload = async (
|
|||
endpoint.searchParams.append("name", name);
|
||||
const fh = await open(path);
|
||||
try {
|
||||
const stream = fh.readableWebStream();
|
||||
const resp = await github.request({
|
||||
method: "POST",
|
||||
url: endpoint.toString(),
|
||||
|
@ -189,7 +188,7 @@ export const upload = async (
|
|||
"content-type": mime,
|
||||
authorization: `token ${config.github_token}`,
|
||||
},
|
||||
data: stream,
|
||||
data: fh.readableWebStream(),
|
||||
});
|
||||
const json = resp.data;
|
||||
if (resp.status !== 201) {
|
||||
|
@ -202,7 +201,7 @@ export const upload = async (
|
|||
console.log(`✅ Uploaded ${name}`);
|
||||
return json;
|
||||
} finally {
|
||||
await fh.close().catch(() => {});
|
||||
await fh.close();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -91,10 +91,7 @@ const parseMakeLatest = (
|
|||
export const paths = (patterns: string[]): string[] => {
|
||||
return patterns.reduce((acc: string[], pattern: string): string[] => {
|
||||
return acc.concat(
|
||||
glob
|
||||
.sync(pattern)
|
||||
.filter((path) => statSync(path).isFile())
|
||||
.map((path) => path.replace(/\\/g, "/")),
|
||||
glob.sync(pattern).filter((path) => statSync(path).isFile()),
|
||||
);
|
||||
}, []);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue