diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-08-18 11:10:28 +0300 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-08-18 11:10:28 +0300 |
commit | e01026b95f3e877fff6f4bd11fd5623c66abf41d (patch) | |
tree | bb6d87a5be201e55db63c6d6c2cc5abb9536aced | |
parent | f05acabe75dcd67185e358f799d3070bfdcbd8c1 (diff) |
Allow to exclude botsfeat/changelog-no-bot
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
-rw-r--r-- | changelog/index.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/changelog/index.php b/changelog/index.php index eb664ca..f1b62fa 100644 --- a/changelog/index.php +++ b/changelog/index.php @@ -30,6 +30,12 @@ class GenerateChangelogCommand extends Command InputOption::VALUE_REQUIRED, 'What format should the output have? (markdown, forum, html)', 'markdown' + ) + ->addOption( + 'no-bots', + null, + InputOption::VALUE_NONE, + 'Remove automated PRs and commits from all results' ); ; } @@ -229,6 +235,12 @@ class GenerateChangelogCommand extends Command } foreach ($commits as $commit) { + $noBots = $input->getOption('no-bots'); + $name = $commit['commit']['author']['name']; + if ($noBots && (str_contains($name, '[bot]') || str_contains($name, 'nextcloud-'))) { + // ignore this bot-created commit + continue; + } $fullMessage = $commit['commit']['message']; list($firstLine,) = explode("\n", $fullMessage, 2); if (substr($firstLine, 0, 20) === 'Merge pull request #') { |