Skip to content

Commit

Permalink
[AAE-19365] Fix for changelog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
popovicsandras committed Jan 11, 2024
1 parent 9515e0e commit 46484f6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/cli/scripts/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { argv, exit } from 'node:process';
import * as shell from 'shelljs';
import * as path from 'path';
import program from 'commander';
import { logger } from './logger';
import * as fs from 'fs';
import * as ejs from 'ejs';

Expand Down Expand Up @@ -116,7 +117,15 @@ function getCommits(options: DiffOptions): Array<Commit> {

return log
.split('\\n')
.map((str: string) => JSON.parse(str) as Commit)
.map((str: string) => {
try {
return JSON.parse(str) as Commit;
} catch (error) {
logger.error(`Unparsable commit message: ${str}, dropping it... Please apply manual fix.`);
return null;
}
})
.filter((commit) => commit !== null)
.filter((commit: Commit) => commitAuthorAllowed(commit, authorFilter));
}

Expand Down

0 comments on commit 46484f6

Please sign in to comment.