Skip to content

Commit b594c31

Browse files
authored
Fix: argparse should_add_reviewers
1 parent a0a54b6 commit b594c31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deploy_bot/get_reviewers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ def find_contributors_to_branch(repository: str, head_branch: str, base_branch:
3131
return {commit.get("author").get("login") for commit in commits}
3232

3333

34+
def cast_bool_arg(val: str) -> bool:
35+
"""Casts value from argparse to bool."""
36+
return val.lower() == "true"
37+
38+
3439
if __name__ == "__main__":
3540

3641
import argparse
@@ -54,7 +59,7 @@ def find_contributors_to_branch(repository: str, head_branch: str, base_branch:
5459
"--should-add-reviewers",
5560
dest="should_add_reviewers",
5661
help="if should add reviewers to PR",
57-
type=bool,
62+
type=cast_bool_arg,
5863
)
5964
parser.add_argument(
6065
"--required-reviewers",

0 commit comments

Comments
 (0)