From c2377a752c573fab3540270ca458c64ed2704446 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 9 Mar 2023 02:05:29 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Make=20change=20notes=20ignoring=20?= =?UTF-8?q?label=20customizable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will allow the end users to set their own label name for letting the bot ignore missing changelog fragments in PRs. Ref: https://github.com/sanitizers/chronographer-github-app/issues/12. --- README.md | 3 +++ chronographer/event_handlers.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c1b27f..a59b440 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ exclude: humans: - pyup-bot +labels: + skip-changelog: skip news # default: `bot:chronographer:skip` + ... ``` diff --git a/chronographer/event_handlers.py b/chronographer/event_handlers.py index 880904d..b9d356a 100644 --- a/chronographer/event_handlers.py +++ b/chronographer/event_handlers.py @@ -148,7 +148,10 @@ async def on_pr(event): {external_docs_url!s} """ - if LABEL_SKIP in pr_labels: + labels_config = repo_config.get('labels', {}) + repo_skip_label = labels_config.get('skip-changelog', LABEL_SKIP) + + if repo_skip_label in pr_labels: logger.info( 'Skipping PR event because the `%s` label is present', LABEL_SKIP,