diff --git a/tools/pull_request_hooks/changelogParser.js b/tools/pull_request_hooks/changelogParser.js index 1c531fa828d..d17472140e9 100644 --- a/tools/pull_request_hooks/changelogParser.js +++ b/tools/pull_request_hooks/changelogParser.js @@ -39,7 +39,7 @@ function parseChangelogBody(lines, openTag) { if (match) { const [_, type, description] = match; - const entry = CHANGELOG_KEYS_TO_ENTRY[type]; + const entry = CHANGELOG_KEYS_TO_ENTRY[type.toLowerCase()]; if (!entry || entry.placeholders.includes(description)) { continue; diff --git a/tools/pull_request_hooks/changelogParser.test.js b/tools/pull_request_hooks/changelogParser.test.js index aeea8664246..fdb460ed34a 100644 --- a/tools/pull_request_hooks/changelogParser.test.js +++ b/tools/pull_request_hooks/changelogParser.test.js @@ -14,6 +14,19 @@ assert.equal(basicChangelog.changes.length, 1); assert.equal(basicChangelog.changes[0].type.changelogKey, "rscadd"); assert.equal(basicChangelog.changes[0].description, "Adds new stuff"); +// Case-insensitivity test +const mixedCaseChangelog = parseChangelog(` + My cool PR! + :cl: DenverCoder9 + Add: Adds new stuff + /:cl: +`); + +assert.equal(mixedCaseChangelog.author, "DenverCoder9"); +assert.equal(mixedCaseChangelog.changes.length, 1); +assert.equal(mixedCaseChangelog.changes[0].type.changelogKey, "rscadd"); +assert.equal(mixedCaseChangelog.changes[0].description, "Adds new stuff"); + // Multi-line test const multiLineChangelog = parseChangelog(` My cool PR!