File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 88import sys
99import json
1010
11+ # TODO(boomanaiden154): Remove the optional call once we can require Python
12+ # 3.10.
13+ from typing import Optional
14+
1115import requests
1216import github
1317import github .PullRequest
2024COMMENT_TAG = "<!--PREMERGE ADVISOR COMMENT: {platform}-->"
2125
2226
23- def get_comment_id (platform : str , pr : github .PullRequest .PullRequest ) -> int | None :
27+ def get_comment_id (platform : str , pr : github .PullRequest .PullRequest ) -> Optional [ int ] :
2428 platform_comment_tag = COMMENT_TAG .format (platform = platform )
2529 for comment in pr .as_issue ().get_comments ():
2630 if platform_comment_tag in comment .body :
@@ -76,8 +80,10 @@ def main(
7680 if return_code == 0 :
7781 with open ("comment" , "w" ) as comment_file_handle :
7882 comment = get_comment (
83+ github_token ,
84+ pr_number ,
7985 ":white_check_mark: With the latest revision this PR passed "
80- "the premerge checks."
86+ "the premerge checks." ,
8187 )
8288 if comment ["id" ]:
8389 json .dump ([comment ], comment_file_handle )
You can’t perform that action at this time.
0 commit comments