Skip to content

Commit

Permalink
pr_labeler: add --force-process-closed flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gotmax23 committed Oct 4, 2023
1 parent edf375f commit 0ad13d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hacking/pr_labeler/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand All @@ -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)

Expand All @@ -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

Expand Down

0 comments on commit 0ad13d7

Please sign in to comment.