1313 Searches for issues in a GitHub repository that match the given search query.
1414 auth_to_github() -> github3.GitHub: Connect to GitHub API with token authentication.
1515 get_per_issue_metrics(issues: Union[List[dict], List[github3.issues.Issue]],
16- discussions: bool = False), labels: Union[List[str], None] = None, ignore_users: List[str] = [] -> tuple[List, int, int]:
16+ discussions: bool = False), labels: Union[List[str], None] = None,
17+ ignore_users: List[str] = [] -> tuple[List, int, int]:
1718 Calculate the metrics for each issue in a list of GitHub issues.
1819 get_owner(search_query: str) -> Union[str, None]]:
1920 Get the owner from the search query.
@@ -123,10 +124,12 @@ def auth_to_github() -> github3.GitHub:
123124 if token := os .getenv ("GH_TOKEN" ):
124125 if not os .getenv ("GITHUB_SERVER_URL" ):
125126 github_connection = github3 .login (token = token )
126- elif os .getenv ("GITHUB_SERVER_URL" ) == ' https://github.com' :
127+ elif os .getenv ("GITHUB_SERVER_URL" ) == " https://github.com" :
127128 github_connection = github3 .login (token = token )
128129 else :
129- github_connection = github3 .GitHubEnterprise (os .getenv ("GITHUB_SERVER_URL" ),token = token )
130+ github_connection = github3 .GitHubEnterprise (
131+ os .getenv ("GITHUB_SERVER_URL" ), token = token
132+ )
130133 else :
131134 raise ValueError ("GH_TOKEN environment variable not set" )
132135
@@ -137,7 +140,7 @@ def get_per_issue_metrics(
137140 issues : Union [List [dict ], List [github3 .search .IssueSearchResult ]], # type: ignore
138141 discussions : bool = False ,
139142 labels : Union [List [str ], None ] = None ,
140- ignore_users : List [str ] = [] ,
143+ ignore_users : List [str ] = None ,
141144) -> tuple [List , int , int ]:
142145 """
143146 Calculate the metrics for each issue/pr/discussion in a list provided.
@@ -159,6 +162,8 @@ def get_per_issue_metrics(
159162 issues_with_metrics = []
160163 num_issues_open = 0
161164 num_issues_closed = 0
165+ if ignore_users is None :
166+ ignore_users = []
162167
163168 for issue in issues :
164169 if discussions :
@@ -320,6 +325,7 @@ def main():
320325 average_time_in_labels ,
321326 num_issues_open ,
322327 num_issues_closed ,
328+ search_query ,
323329 )
324330 write_to_markdown (
325331 issues_with_metrics ,
@@ -330,6 +336,7 @@ def main():
330336 num_issues_open ,
331337 num_issues_closed ,
332338 labels ,
339+ search_query ,
333340 )
334341
335342
0 commit comments