@@ -227,7 +227,7 @@ def get_commit(self, repo: str, sha: str) -> Any:
227
227
"""
228
228
return self .get_cached (f"/repos/{ repo } /commits/{ sha } " )
229
229
230
- def get_merge_commit_sha_from_commit (self , repo : str , sha : str ) -> str | None :
230
+ def get_merge_commit_sha_from_commit (self , repo : Repository , sha : str ) -> str | None :
231
231
"""
232
232
Get the merge commit sha from a commit sha.
233
233
"""
@@ -246,21 +246,21 @@ def get_merge_commit_sha_from_commit(self, repo: str, sha: str) -> str | None:
246
246
247
247
return pull_request .get ("merge_commit_sha" )
248
248
249
- def get_pullrequest_from_commit (self , repo : str , sha : str ) -> Any :
249
+ def get_pullrequest_from_commit (self , repo : Repository , sha : str ) -> Any :
250
250
"""
251
251
https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit
252
252
253
253
Returns the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.
254
254
"""
255
- return self .get (f"/repos/{ repo } /commits/{ sha } /pulls" )
255
+ return self .get (f"/repos/{ repo . name } /commits/{ sha } /pulls" )
256
256
257
- def get_pullrequest_files (self , repo : str , pull_number : str ) -> Any :
257
+ def get_pullrequest_files (self , repo : Repository , pull_number : str ) -> Any :
258
258
"""
259
259
https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files
260
260
261
261
Returns up to 30 files associated with a pull request. Responses are paginated.
262
262
"""
263
- return self .get (f"/repos/{ repo } /pulls/{ pull_number } /files" )
263
+ return self .get (f"/repos/{ repo . name } /pulls/{ pull_number } /files" )
264
264
265
265
def get_repo (self , repo : str ) -> Any :
266
266
"""
@@ -419,17 +419,17 @@ def create_issue(self, repo: str, data: Mapping[str, Any]) -> Any:
419
419
endpoint = f"/repos/{ repo } /issues"
420
420
return self .post (endpoint , data = data )
421
421
422
- def create_comment (self , repo : str , issue_id : str , data : Mapping [str , Any ]) -> Any :
422
+ def create_comment (self , repo : Repository , issue_id : str , data : Mapping [str , Any ]) -> Any :
423
423
"""
424
424
https://docs.github.com/en/rest/issues/comments#create-an-issue-comment
425
425
"""
426
- endpoint = f"/repos/{ repo } /issues/{ issue_id } /comments"
426
+ endpoint = f"/repos/{ repo . name } /issues/{ issue_id } /comments"
427
427
return self .post (endpoint , data = data )
428
428
429
429
def update_comment (
430
- self , repo : str , issue_id : str , comment_id : str , data : Mapping [str , Any ]
430
+ self , repo : Repository , issue_id : str , comment_id : str , data : Mapping [str , Any ]
431
431
) -> Any :
432
- endpoint = f"/repos/{ repo } /issues/comments/{ comment_id } "
432
+ endpoint = f"/repos/{ repo . name } /issues/comments/{ comment_id } "
433
433
return self .patch (endpoint , data = data )
434
434
435
435
def get_comment_reactions (self , repo : str , comment_id : str ) -> Any :
0 commit comments