Add input option overwrite_files.

This commit is contained in:
Adriano dos Santos Fernandes 2023-03-30 22:08:17 -03:00
parent c9b46fe7aa
commit 40ca4763d5
7 changed files with 52 additions and 19 deletions

View file

@ -67,17 +67,23 @@ async function run() {
}
const currentAssets = rel.assets;
const assets = await Promise.all(
files.map(async (path) => {
const json = await upload(
config,
gh,
uploadUrl(rel.upload_url),
path,
currentAssets
);
delete json.uploader;
return json;
})
files
.map(async (path) => {
const json = await upload(
config,
gh,
uploadUrl(rel.upload_url),
path,
currentAssets
);
if (json) {
delete json.uploader;
}
return json;
})
.filter((json) => json !== null)
).catch((error) => {
throw error;
});