From bcb15844dd757060f9f6dbcef91c96c3b4d9d5ae Mon Sep 17 00:00:00 2001 From: Vasily Kuzin Date: Fri, 9 Jun 2023 17:19:26 +0300 Subject: [PATCH 1/2] feat: add option to sign git tags --- src/commands/default.ts | 2 +- src/config.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/default.ts b/src/commands/default.ts index 0645e3e..63718cb 100644 --- a/src/commands/default.ts +++ b/src/commands/default.ts @@ -105,7 +105,7 @@ export default async function defaultMain(args: Argv) { "{{newVersion}}", config.newVersion ); - await execa("git", ["tag", "-am", msg, body], { cwd }); + await execa("git", ["tag", config.signTags && "-s", "-am", msg, body], { cwd }); } if (args.push === true) { await execa("git", ["push", "--follow-tags"], { cwd }); diff --git a/src/config.ts b/src/config.ts index 210ad07..2f509de 100644 --- a/src/config.ts +++ b/src/config.ts @@ -14,6 +14,7 @@ export interface ChangelogConfig { from: string; to: string; newVersion?: string; + signTags?: boolean; output: string | boolean; templates: { commitMessage?: string; From 9a8b1ef28870250ccab49a920f67771f40aa4ea1 Mon Sep 17 00:00:00 2001 From: Vasily Kuzin Date: Fri, 9 Jun 2023 17:25:21 +0300 Subject: [PATCH 2/2] change method of adding option conditionally --- src/commands/default.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/default.ts b/src/commands/default.ts index 63718cb..79704f7 100644 --- a/src/commands/default.ts +++ b/src/commands/default.ts @@ -105,7 +105,7 @@ export default async function defaultMain(args: Argv) { "{{newVersion}}", config.newVersion ); - await execa("git", ["tag", config.signTags && "-s", "-am", msg, body], { cwd }); + await execa("git", ["tag", ...(config.signTags ? ["-s"] : []), "-am", msg, body], { cwd }); } if (args.push === true) { await execa("git", ["push", "--follow-tags"], { cwd });