Skip to content

Commit

Permalink
fix line parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dleviminzi committed Sep 26, 2024
1 parent 23addef commit c624ad7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit c624ad7

Please sign in to comment.