mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-06-27 22:06:03 +00:00
feat: add input option overwrite_files. (#343)
Some checks are pending
main / build (push) Waiting to run
Some checks are pending
main / build (push) Waiting to run
* Add input option overwrite_files. * Fix description. * update test and run fmt/build Signed-off-by: Rui Chen <rui@chenrui.dev> --------- Signed-off-by: Rui Chen <rui@chenrui.dev> Co-authored-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
parent
5822334cb4
commit
605f567f95
7 changed files with 50 additions and 18 deletions
24
src/main.ts
24
src/main.ts
|
@ -1,13 +1,13 @@
|
|||
import { setFailed, setOutput } from "@actions/core";
|
||||
import { getOctokit } from "@actions/github";
|
||||
import { GitHubReleaser, release, upload } from "./github";
|
||||
import {
|
||||
paths,
|
||||
parseConfig,
|
||||
isTag,
|
||||
parseConfig,
|
||||
paths,
|
||||
unmatchedPatterns,
|
||||
uploadUrl,
|
||||
} from "./util";
|
||||
import { release, upload, GitHubReleaser } from "./github";
|
||||
import { getOctokit } from "@actions/github";
|
||||
import { setFailed, setOutput } from "@actions/core";
|
||||
|
||||
import { env } from "process";
|
||||
|
||||
|
@ -86,19 +86,23 @@ async function run() {
|
|||
path,
|
||||
currentAssets,
|
||||
);
|
||||
delete json.uploader;
|
||||
if (json) {
|
||||
delete json.uploader;
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
let assets;
|
||||
let results: (any | null)[];
|
||||
if (!config.input_preserve_order) {
|
||||
assets = await Promise.all(files.map(uploadFile));
|
||||
results = await Promise.all(files.map(uploadFile));
|
||||
} else {
|
||||
assets = [];
|
||||
results = [];
|
||||
for (const path of files) {
|
||||
assets.push(await uploadFile(path));
|
||||
results.push(await uploadFile(path));
|
||||
}
|
||||
}
|
||||
|
||||
const assets = results.filter(Boolean);
|
||||
setOutput("assets", assets);
|
||||
}
|
||||
console.log(`🎉 Release ready at ${rel.html_url}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue