Skip to content

Commit

Permalink
Pull request id is always a number, so parse appropriate command-line…
Browse files Browse the repository at this point in the history
… argument as int to impose additional sanity checking
  • Loading branch information
oleg-derevenetz authored and platisd committed Jul 23, 2021
1 parent 09a07b5 commit c9c79f2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions run_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def main():
help="The path to the clang-tidy fixes YAML",
)
parser.add_argument(
"--pull-request-id", type=str, required=True, help="The pull request ID"
"--pull-request-id",
type=int,
required=True,
help="The pull request ID",
)
parser.add_argument(
"--repository-root",
Expand All @@ -53,7 +56,7 @@ def main():
pull_request_files = []
# Request a maximum of 100 pages (3000 files)
for page_num in range(1, 101):
pull_files_url = "%s/repos/%s/pulls/%s/files?page=%d" % (
pull_files_url = "%s/repos/%s/pulls/%d/files?page=%d" % (
github_api_url,
repo,
args.pull_request_id,
Expand Down Expand Up @@ -247,7 +250,7 @@ def main():
existing_pull_request_comments = []
# Request a maximum of 100 pages (3000 comments)
for page_num in range(1, 101):
pull_comments_url = "%s/repos/%s/pulls/%s/comments?page=%d" % (
pull_comments_url = "%s/repos/%s/pulls/%d/comments?page=%d" % (
github_api_url,
repo,
args.pull_request_id,
Expand Down Expand Up @@ -307,7 +310,7 @@ def main():
)
current_review += 1

pull_request_reviews_url = "%s/repos/%s/pulls/%s/reviews" % (
pull_request_reviews_url = "%s/repos/%s/pulls/%d/reviews" % (
github_api_url,
repo,
args.pull_request_id,
Expand Down

0 comments on commit c9c79f2

Please sign in to comment.