Skip to content

Commit 444f86a

Browse files
committed
fix: generate correct compare url for initial tag
1 parent 3a20974 commit 444f86a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/updateVersion.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ const nextVersion = semver.inc(
110110
(cli.flags.prerelease !== undefined ? 'pre' : '') + (hasBreaking ? 'major' : hasFeatures ? 'minor' : 'patch'),
111111
identifier
112112
)
113-
let md = `## [${nextVersion}](${repoUrl}/compare/${lastTag}...v${nextVersion}) (${new Date().toDateString()})\n`
113+
114+
const compareUrl = lastTag ? `${repoUrl}/compare/${lastTag}...v${nextVersion}` : `${repoUrl}/commits/v${nextVersion}`
115+
let md = `## [${nextVersion}](${compareUrl}) (${new Date().toDateString()})\n`
114116

115117
if (Object.keys(breakingChanges).length) {
116118
md += '\n## Breaking changes\n'

0 commit comments

Comments
 (0)