mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
[ez] Fix check labels error when deleting comment (#140578)
Re make of https://github.com/pytorch/pytorch/pull/140587 Pull Request resolved: https://github.com/pytorch/pytorch/pull/140578 Approved by: https://github.com/huydhn
This commit is contained in:
committed by
PyTorch MergeBot
parent
274f4cfacb
commit
08acfcddc4
6
.github/scripts/github_utils.py
vendored
6
.github/scripts/github_utils.py
vendored
@@ -73,10 +73,10 @@ def gh_fetch_url(
|
||||
headers: Optional[Dict[str, str]] = None,
|
||||
data: Union[Optional[Dict[str, Any]], str] = None,
|
||||
method: Optional[str] = None,
|
||||
reader: Callable[[Any], Any] = lambda x: x.read(),
|
||||
reader: Callable[[Any], Any] = json.load,
|
||||
) -> Any:
|
||||
return gh_fetch_url_and_headers(
|
||||
url, headers=headers, data=data, reader=json.load, method=method
|
||||
url, headers=headers, data=data, reader=reader, method=method
|
||||
)[1]
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ def gh_close_pr(org: str, repo: str, pr_num: int, dry_run: bool = False) -> None
|
||||
|
||||
def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
|
||||
url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
|
||||
gh_fetch_url(url, method="DELETE")
|
||||
gh_fetch_url(url, method="DELETE", reader=lambda x: x.read())
|
||||
|
||||
|
||||
def gh_fetch_merge_base(org: str, repo: str, base: str, head: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user