@@ -15,14 +15,18 @@ def main():
1515 # for convenience
1616 local_github_token : str | None = None
1717 github_token : str | None = (
18- local_github_token or os .getenv ("GITHUB_ACCESS_TOKEN " )
18+ local_github_token or os .getenv ("GITHUB_TOKEN " )
1919 )
2020 github = Github (github_token )
2121
2222 # repository name
2323 repo_name : str = "pvlib/pvlib-python"
2424 repository : Repository = github .get_repo (repo_name )
2525
26+ # Number of top issues to list
27+ MAX_ISSUES = 19
28+ TOP_ISSUES_CARD_NUMBER = 2196
29+
2630 # Rate limiting
2731 remaining_requests_before : int = github .rate_limiting [0 ]
2832 print (f"Remaining requests before: { remaining_requests_before } " )
@@ -36,7 +40,12 @@ def main():
3640
3741 # Format markdown
3842 ranked_issues = []
39- for i , issue in enumerate (issues ):
43+ for (i , issue ) in zip (range (MAX_ISSUES ), issues ):
44+
45+ # Don't include the overview card
46+ if issue .number == TOP_ISSUES_CARD_NUMBER :
47+ pass
48+
4049 markdown_bullet_point : str = (
4150 f"{ issue .html_url } " +
4251 f"({ issue ._rawData ['reactions' ]['+1' ]} :thumbsup:)"
@@ -45,11 +54,10 @@ def main():
4554 markdown_bullet_point = f"{ i + 1 } . { markdown_bullet_point } "
4655 ranked_issues .append (markdown_bullet_point )
4756
48- if i >= 19 :
49- break
50-
5157 # edit top issues
52- top_issues_card : Issue = repository .get_issue (number = 2196 )
58+ top_issues_card : Issue = repository .get_issue (
59+ number = TOP_ISSUES_CARD_NUMBER
60+ )
5361 header = "Top Ranking Issues"
5462 new_body = header + "\n " + "\n " .join (ranked_issues )
5563 top_issues_card .edit (
0 commit comments