From e01026b95f3e877fff6f4bd11fd5623c66abf41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Thu, 18 Aug 2022 10:10:28 +0200 Subject: Allow to exclude bots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- changelog/index.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 #') { -- cgit v1.2.3