@@ -302,7 +302,8 @@ def list_open_issues_prs(self, repo_owner: str, issue: Literal['pr', 'issue'] =
302302 "created_at" : item ['created_at' ],
303303 "updated_at" : item ['updated_at' ],
304304 "author" : item ['user' ]['login' ],
305- "label_names" : [label ['name' ] for label in item .get ('labels' , [])]
305+ "label_names" : [label ['name' ] for label in item .get ('labels' , [])],
306+ "is_draft" : item .get ('draft' , False ),
306307 }
307308 for item in pr_data ['items' ]
308309 ]
@@ -407,7 +408,7 @@ def get_latest_sha(self, repo_owner: str, repo_name: str) -> Optional[str]:
407408 Logs errors and warnings if the request fails, the response is invalid, or no commits are found.
408409 Returns None in case of exceptions or if the repository has no commits.
409410 """
410- logging .info (f"Fetching latest commit SHA for { repo_owner } /{ repo_name } " )
411+ logging .info ({ "status" : "info" , "message" : f"Fetching latest commit SHA for { repo_owner } /{ repo_name } " } )
411412
412413 # Construct the commits URL
413414 commits_url = f"https://api.github.com/repos/{ repo_owner } /{ repo_name } /commits"
@@ -420,10 +421,10 @@ def get_latest_sha(self, repo_owner: str, repo_name: str) -> Optional[str]:
420421
421422 if commits_data :
422423 latest_sha = commits_data [0 ]['sha' ]
423- logging .info (f"Latest commit SHA fetched successfully" )
424+ logging .info ({ "status" : "info" , "message" : f"Latest commit SHA: { latest_sha } " } )
424425 return latest_sha
425426 else :
426- logging .warning (" No commits found in the repository" )
427+ logging .warning ({ "status" : "warning" , "message" : " No commits found in the repository"} )
427428 return None
428429
429430 except Exception as e :
0 commit comments