Skip to content

Commit cfcf633

Browse files
committed
Changelog generator - strip duplicated PR number from entry
1 parent c8d1d89 commit cfcf633

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

changelog-generator/run.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use function exec;
3030
use function explode;
3131
use function implode;
32+
use function preg_replace;
3233
use function sprintf;
3334

3435
(function (): void {
@@ -201,7 +202,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
201202
$thanksText = '';
202203
}
203204

204-
$output->writeln(sprintf('* %s (%s)%s%s', $commit['message'], $parenthesis, count($issuesToReference) > 0 ? ', ' . implode(', ', $issuesToReference) : '', $thanksText));
205+
$message = preg_replace('/\s*\(#\d+\)$/', '', $commit['message']);
206+
$output->writeln(sprintf('* %s (%s)%s%s', $message, $parenthesis, count($issuesToReference) > 0 ? ', ' . implode(', ', $issuesToReference) : '', $thanksText));
205207
}
206208

207209
return 0;

0 commit comments

Comments
 (0)