Skip to content

Commit

Permalink
Fix: argparse should_add_reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansingman authored Aug 30, 2024
1 parent a0a54b6 commit b594c31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deploy_bot/get_reviewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def find_contributors_to_branch(repository: str, head_branch: str, base_branch:
return {commit.get("author").get("login") for commit in commits}


def cast_bool_arg(val: str) -> bool:
"""Casts value from argparse to bool."""
return val.lower() == "true"


if __name__ == "__main__":

import argparse
Expand All @@ -54,7 +59,7 @@ def find_contributors_to_branch(repository: str, head_branch: str, base_branch:
"--should-add-reviewers",
dest="should_add_reviewers",
help="if should add reviewers to PR",
type=bool,
type=cast_bool_arg,
)
parser.add_argument(
"--required-reviewers",
Expand Down

0 comments on commit b594c31

Please sign in to comment.