From 0ad13d7b17a9c8a7a2cdd72540a2fe71db74f683 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 4 Oct 2023 18:28:33 +0000 Subject: [PATCH] pr_labeler: add --force-process-closed flag --- hacking/pr_labeler/label.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hacking/pr_labeler/label.py b/hacking/pr_labeler/label.py index a9f525660b..ac19ddae18 100644 --- a/hacking/pr_labeler/label.py +++ b/hacking/pr_labeler/label.py @@ -246,6 +246,7 @@ def process_pr( pr_number: int, dry_run: bool = False, authed_dry_run: bool = False, + force_process_closed: bool = False, ) -> None: global_args = click_ctx.ensure_object(GlobalArgs) @@ -266,7 +267,7 @@ def process_pr( event_info=get_event_info(), issue=pr.as_issue(), ) - if pr.state != "open": + if not force_process_closed and pr.state != "open": log(ctx, "Refusing to process closed ticket") return @@ -283,6 +284,7 @@ def process_issue( issue_number: int, dry_run: bool = False, authed_dry_run: bool = False, + force_process_closed: bool = False, ) -> None: global_args = click_ctx.ensure_object(GlobalArgs) @@ -301,7 +303,7 @@ def process_issue( dry_run=dry_run, event_info=get_event_info(), ) - if issue.state != "open": + if not force_process_closed and issue.state != "open": log(ctx, "Refusing to process closed ticket") return