From 2036c3473b6852a5461ccb86f11b56836cfd9241 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Sun, 23 Jul 2023 14:05:25 +0200 Subject: [PATCH] fix get all untagged commits for first release --- src/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 23e4510..234c614 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,7 +65,7 @@ async function run() { return; } - const lastestTag = tags.latest || "0.1.0"; + const lastestTag = tags.latest || "0.0.0"; if (tags.latest) { console.log("# Lastest tag is:", c.green(lastestTag)); } else { @@ -74,10 +74,14 @@ async function run() { ); } - const unTaggedCommits = await git.log({ - from: lastestTag, - to: releaseBranch, - }); + const unTaggedCommits = await git.log( + lastestTag === "0.0.0" + ? [releaseBranch] // use all commits of release branch if first release + : { + from: lastestTag, + to: releaseBranch, + } + ); if (unTaggedCommits.total === 0) { console.log(c.yellow("# No untagged commits found, skipping."));