Skip to content

Commit 822f370

Browse files
committed
chore: update changelog when there are no updates
[skip ci]
1 parent 2565a80 commit 822f370

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

infra/release/src/changelog.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ const createInitial = (version: string) => {
3939
`
4040
}
4141

42+
const createChangelog = (version: string, changelog: string) => {
43+
if (changelog) {
44+
return changelog
45+
}
46+
return `## v${version} (${getCurrentDate()})
47+
48+
No updates!
49+
`
50+
}
51+
4252
console.log('Start generating changelog...')
4353
const result = shell.exec('pnpm exec lerna-changelog --next-version-from-metadata', { silent: true })
4454

@@ -59,7 +69,7 @@ const BANNER = `
5969
### ###
6070
#######################`
6171

62-
const orgNewChangelog = isNoGitTags ? createInitial(pkg.version) : result.stdout
72+
const orgNewChangelog = isNoGitTags ? createInitial(pkg.version) : createChangelog(pkg.version, result.stdout.trim())
6373

6474
const isPreRelease = Boolean(process.env.VSCODE_WDIO_PRE_RELEASE_PATCH_NUMBER || '')
6575

0 commit comments

Comments
 (0)