13
13
Searches for issues in a GitHub repository that match the given search query.
14
14
auth_to_github() -> github3.GitHub: Connect to GitHub API with token authentication.
15
15
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]:
17
18
Calculate the metrics for each issue in a list of GitHub issues.
18
19
get_owner(search_query: str) -> Union[str, None]]:
19
20
Get the owner from the search query.
@@ -123,10 +124,12 @@ def auth_to_github() -> github3.GitHub:
123
124
if token := os .getenv ("GH_TOKEN" ):
124
125
if not os .getenv ("GITHUB_SERVER_URL" ):
125
126
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" :
127
128
github_connection = github3 .login (token = token )
128
129
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
+ )
130
133
else :
131
134
raise ValueError ("GH_TOKEN environment variable not set" )
132
135
@@ -137,7 +140,7 @@ def get_per_issue_metrics(
137
140
issues : Union [List [dict ], List [github3 .search .IssueSearchResult ]], # type: ignore
138
141
discussions : bool = False ,
139
142
labels : Union [List [str ], None ] = None ,
140
- ignore_users : List [str ] = [] ,
143
+ ignore_users : List [str ] = None ,
141
144
) -> tuple [List , int , int ]:
142
145
"""
143
146
Calculate the metrics for each issue/pr/discussion in a list provided.
@@ -159,6 +162,8 @@ def get_per_issue_metrics(
159
162
issues_with_metrics = []
160
163
num_issues_open = 0
161
164
num_issues_closed = 0
165
+ if ignore_users is None :
166
+ ignore_users = []
162
167
163
168
for issue in issues :
164
169
if discussions :
@@ -320,6 +325,7 @@ def main():
320
325
average_time_in_labels ,
321
326
num_issues_open ,
322
327
num_issues_closed ,
328
+ search_query ,
323
329
)
324
330
write_to_markdown (
325
331
issues_with_metrics ,
@@ -330,6 +336,7 @@ def main():
330
336
num_issues_open ,
331
337
num_issues_closed ,
332
338
labels ,
339
+ search_query ,
333
340
)
334
341
335
342
0 commit comments