From c624ad782722771b1393f42549fb5d60a4135180 Mon Sep 17 00:00:00 2001 From: Daniel Levi-Minzi Date: Thu, 26 Sep 2024 17:43:00 -0400 Subject: [PATCH] fix line parsing --- .github/workflows/release-changelog.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-changelog.yml b/.github/workflows/release-changelog.yml index d5f94e94c..ba789baec 100644 --- a/.github/workflows/release-changelog.yml +++ b/.github/workflows/release-changelog.yml @@ -63,15 +63,18 @@ jobs: const fixes = []; for (const line of lines) { if (line.startsWith('*')) { - const [_, type, description] = line.match(/^\*\s*(feat|fix):\s*(.*)$/); - if (type === 'feat') { + const m = line.match(/^\*\s*(Feat|Fix):\s*(.*)$/); + if (m) { + const [_, type, description] = m; const byIndex = description.indexOf('by'); - const cleanedDesc = description.slice(0, byIndex).replace('* feat:', '').trim(); - feats.push(cleanedDesc); - } else if (type === 'fix') { - const byIndex = description.indexOf('by'); - const cleanedDesc = description.slice(0, byIndex).replace('* fix:', '').trim(); - fixes.push(cleanedDesc); + + if (type === 'Feat') { + const cleanedDesc = description.slice(0, byIndex).trim(); + feats.push(cleanedDesc); + } else if (type === 'Fix') { + const cleanedDesc = description.slice(0, byIndex).trim(); + fixes.push(cleanedDesc); + } } } }