mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-07-16 11:14:53 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f3cad8bcbf | ||
|
07a2257003 |
@@ -1,3 +1,9 @@
|
|||||||
|
## 2.3.1
|
||||||
|
|
||||||
|
### Bug fixes 🐛
|
||||||
|
|
||||||
|
* fix: fix file closing issue by @WailGree in https://github.com/softprops/action-gh-release/pull/629
|
||||||
|
|
||||||
## 2.3.0
|
## 2.3.0
|
||||||
|
|
||||||
* Migrate from jest to vitest
|
* Migrate from jest to vitest
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "action-gh-release",
|
"name": "action-gh-release",
|
||||||
"version": "2.2.2",
|
"version": "2.3.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "GitHub Action for creating GitHub Releases",
|
"description": "GitHub Action for creating GitHub Releases",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
@@ -180,6 +180,7 @@ export const upload = async (
|
|||||||
endpoint.searchParams.append("name", name);
|
endpoint.searchParams.append("name", name);
|
||||||
const fh = await open(path);
|
const fh = await open(path);
|
||||||
try {
|
try {
|
||||||
|
const stream = fh.readableWebStream();
|
||||||
const resp = await github.request({
|
const resp = await github.request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: endpoint.toString(),
|
url: endpoint.toString(),
|
||||||
@@ -188,7 +189,7 @@ export const upload = async (
|
|||||||
"content-type": mime,
|
"content-type": mime,
|
||||||
authorization: `token ${config.github_token}`,
|
authorization: `token ${config.github_token}`,
|
||||||
},
|
},
|
||||||
data: fh.readableWebStream(),
|
data: stream,
|
||||||
});
|
});
|
||||||
const json = resp.data;
|
const json = resp.data;
|
||||||
if (resp.status !== 201) {
|
if (resp.status !== 201) {
|
||||||
@@ -201,7 +202,7 @@ export const upload = async (
|
|||||||
console.log(`✅ Uploaded ${name}`);
|
console.log(`✅ Uploaded ${name}`);
|
||||||
return json;
|
return json;
|
||||||
} finally {
|
} finally {
|
||||||
await fh.close();
|
await fh.close().catch(() => {});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -91,7 +91,10 @@ const parseMakeLatest = (
|
|||||||
export const paths = (patterns: string[]): string[] => {
|
export const paths = (patterns: string[]): string[] => {
|
||||||
return patterns.reduce((acc: string[], pattern: string): string[] => {
|
return patterns.reduce((acc: string[], pattern: string): string[] => {
|
||||||
return acc.concat(
|
return acc.concat(
|
||||||
glob.sync(pattern).filter((path) => statSync(path).isFile()),
|
glob
|
||||||
|
.sync(pattern)
|
||||||
|
.filter((path) => statSync(path).isFile())
|
||||||
|
.map((path) => path.replace(/\\/g, "/")),
|
||||||
);
|
);
|
||||||
}, []);
|
}, []);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user