Skip to content

Commit ec84e86

Browse files
committed
ignore default changelog text
1 parent bfa3c1a commit ec84e86

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/generate-changelog.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ import shell from 'shelljs'
66
const FIXES_REGEX = /^CHANGELOG-FIXES:(.*)/gm
77
const NEW_REGEX = /^CHANGELOG-NEW:(.*)/gm
88

9+
// Template text for the changelog that should be ignored.
10+
const CHANGELOG_TEMPLATE_TEXT = [
11+
'Insert a single changelog entry here',
12+
'Insert ANOTHER changelog entry here'
13+
]
14+
915
export interface Changelog {
1016
added: string[] | undefined
1117
fixed: string[] | undefined
@@ -197,7 +203,10 @@ function parseChangelogFromPrDescriptions(prDescriptions: string[]): Changelog {
197203
const fixMatchesArray = [...fixMatches]
198204
for (const fixMatch of fixMatchesArray) {
199205
const fixMatchString = fixMatch[1].trim()
200-
if (fixMatchString) {
206+
if (
207+
fixMatchString &&
208+
!CHANGELOG_TEMPLATE_TEXT.includes(fixMatchString)
209+
) {
201210
changelog_fixed.push(fixMatchString)
202211
}
203212
}
@@ -208,7 +217,10 @@ function parseChangelogFromPrDescriptions(prDescriptions: string[]): Changelog {
208217
const addMatchesArray = [...addMatches]
209218
for (const addMatch of addMatchesArray) {
210219
const addMatchString = addMatch[1].trim()
211-
if (addMatchString) {
220+
if (
221+
addMatchString &&
222+
!CHANGELOG_TEMPLATE_TEXT.includes(addMatchString)
223+
) {
212224
changelog_new.push(addMatchString)
213225
}
214226
}

0 commit comments

Comments
 (0)