diff --git a/scripts/generateChangelog.js b/scripts/generateChangelog.js index daf100a4b..81031e160 100644 --- a/scripts/generateChangelog.js +++ b/scripts/generateChangelog.js @@ -36,6 +36,8 @@ if (fs.existsSync(commitUserFile)) { commitUserLookup = JSON.parse(fs.readFileSync(commitUserFile, 'utf8')); } +const whiteLabels = zhc.definitions.filter((d) => d.whiteLabel).flatMap((d) => d.whiteLabel); + for (const changelog of changelogs) { for (const line of changelog.contents) { const releaseMatch = line.match(releaseRe); @@ -77,8 +79,10 @@ for (const changelog of changelogs) { if (localContext === 'add') { for (const model of message.split(',')) { const definition = zhc.definitions.find((d) => d.model === model.trim()); - if (definition) { - messages.push(`\`${definition.model}\` ${definition.vendor} ${definition.description}`); + const whiteLabel = whiteLabels.find((d) => d.model === model.trim()); + const match = definition || whiteLabel; + if (match) { + messages.push(`\`${match.model}\` ${match.vendor} ${match.description}`); } else { changes['error'].push(`${line} (model '${model}' does not exist)`); }