Skip to content
Snippets Groups Projects
Commit dd93c1c1 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: search changelogs down to fourth heading deep

Closes #1687
parent 3eaa75f3
Branches
Tags 11.37.14
No related merge requests found
......@@ -93,8 +93,23 @@ async function getReleaseNotesMd(repository, version) {
logger.trace('Could not parse top level headings. Trying second level');
changelogParsed = changelogMd.match(/^##([^#]+?)\n([^]+?)(?=^##[^#])/gm);
if (!changelogParsed || changelogParsed.length === 1) {
logger.info({ repository }, 'No second level changelogs headings found');
return null;
logger.debug({ repository }, 'No second level changelogs headings found');
changelogParsed = changelogMd.match(
/^###([^#]+?)\n([^]+?)(?=^###[^#])/gm
);
if (!changelogParsed || changelogParsed.length === 1) {
logger.debug(
{ repository },
'No second third changelogs headings found'
);
changelogParsed = changelogMd.match(
/^####([^#]+?)\n([^]+?)(?=^####[^#])/gm
);
if (!changelogParsed || changelogParsed.length === 1) {
logger.info({ repository }, 'No changelogs headings found');
return null;
}
}
}
}
for (const section of changelogParsed) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment