From 8e460614f5b47c8b95ecab5c7eebd1da2e177e4f Mon Sep 17 00:00:00 2001 From: Olivers Vitins Date: Sat, 16 Dec 2023 17:21:07 +0200 Subject: [PATCH] fix(commands): have unreleased section for changelog --- src/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7341721..95e69b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -258,13 +258,15 @@ program console.log("Generation of this changelog is based on commits"); for (const commit of commits) { - const tag = semver.sort( - (await simpleGit().tags([`--contains=${commit.hash}`])).all - )[0]!; + const tag = + semver.sort( + (await simpleGit().tags([`--contains=${commit.hash}`])).all + )[0]! || "Unreleased"; + const currentCommitStack = parsedCommitStacks.find( (commitStack) => commitStack.version === tag ) || { - version: tag || "", + version: tag || "Unreleased", breaking: [], features: [], fixes: [],