From 472c2cfcb4995b05bdad8788bf6dda8c26852d7a Mon Sep 17 00:00:00 2001 From: Ming-Yen Chung Date: Tue, 10 Jun 2025 17:37:57 +0800 Subject: [PATCH] MINOR: Improve the prompt in committer-tools/reviewers.py (#19942) Previously, the confirmation prompt for updating the PR body treated any input other than 'n' as approval, which could lead to unintended actions. With this change, the update will only proceed if the user enters 'y', 'Y', or presses Enter. For any other input, the operation is canceled and an Abort. message is printed. This makes the prompt behavior clearer and more predictable. Reviewers: TengYao Chi , PoAn Yang , Kuan-Po Tseng , Ken Huang , Lan Ding --- committer-tools/reviewers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/committer-tools/reviewers.py b/committer-tools/reviewers.py index a3539f9d9c3..06ba4919213 100755 --- a/committer-tools/reviewers.py +++ b/committer-tools/reviewers.py @@ -63,8 +63,9 @@ def append_message_to_pr_body(pr: int , message: str): return print(f"""New PR body will be:\n\n---\n{updated_pr_body}---\n""") - choice = input(f'Update the body of "{pr_title}"? (y/n): ').strip().lower() - if choice in ['n', 'no']: + choice = input(f'Update the body of "{pr_title}"? [Y/n] ').strip().lower() + if choice not in ['', 'y']: + print("Abort.") return try: