mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 02:44:20 +00:00
Preserve upload order
This commit is contained in:
parent
9a28f2423f
commit
1d3c3ef56a
1 changed files with 22 additions and 15 deletions
19
src/main.ts
19
src/main.ts
|
@ -74,8 +74,8 @@ async function run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const currentAssets = rel.assets;
|
const currentAssets = rel.assets;
|
||||||
const assets = await Promise.all(
|
|
||||||
files.map(async (path) => {
|
const uploadFile = async (path) => {
|
||||||
const json = await upload(
|
const json = await upload(
|
||||||
config,
|
config,
|
||||||
gh,
|
gh,
|
||||||
|
@ -85,10 +85,17 @@ async function run() {
|
||||||
);
|
);
|
||||||
delete json.uploader;
|
delete json.uploader;
|
||||||
return json;
|
return json;
|
||||||
}),
|
};
|
||||||
).catch((error) => {
|
|
||||||
throw error;
|
let assets;
|
||||||
});
|
if (config.preserve_order) {
|
||||||
|
assets = await Promise.all(files.map(uploadFile));
|
||||||
|
} else {
|
||||||
|
assets = [];
|
||||||
|
for (const path of files) {
|
||||||
|
assets.push(await uploadFile(path));
|
||||||
|
}
|
||||||
|
}
|
||||||
setOutput("assets", assets);
|
setOutput("assets", assets);
|
||||||
}
|
}
|
||||||
console.log(`🎉 Release ready at ${rel.html_url}`);
|
console.log(`🎉 Release ready at ${rel.html_url}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue