graceful exit on existing tag

This commit is contained in:
Emmaline Autumn 2025-05-07 09:57:04 -06:00
parent 0150417224
commit bd8daaf54a

View File

@ -35,8 +35,12 @@ try {
console.log(`Tag ${tag} already exists.`); console.log(`Tag ${tag} already exists.`);
created = false; created = false;
} catch { } catch {
await run("git", ["tag", tag]); try {
await run("git", ["push", "origin", tag]); await run("git", ["tag", tag]);
await run("git", ["push", "origin", tag]);
} catch {
created = false;
}
} }
if (created) { if (created) {
const out = Deno.env.get("GITHUB_OUTPUT"); const out = Deno.env.get("GITHUB_OUTPUT");
@ -54,6 +58,7 @@ if (created) {
} else { } else {
console.error("GITHUB_OUTPUT not set."); console.error("GITHUB_OUTPUT not set.");
} }
Deno.exit(0);
} }
async function run(cmd: string, args: string[]) { async function run(cmd: string, args: string[]) {