@@ -29,6 +29,15 @@ def get_total_commits(repo):
2929 return counts
3030
3131
32+ def get_total_deployments (repo ):
33+ """Get total deployments in a repository."""
34+ try :
35+ counts = repo .get_deployments ().totalCount
36+ except :
37+ counts = 0
38+ return counts
39+
40+
3241def get_commit_history (repo ):
3342 """Get commit history for a repository."""
3443 total = get_total_commits (repo )
@@ -80,9 +89,9 @@ def get_config_readme(repo_name):
8089# ----------------------------
8190# query information from github about the organization
8291gh_instance = Github (auth = Auth .Token (os .environ ["GITHUB_TOKEN" ]))
83- logger .info ("authenticated to Github as %s" , gh_instance . get_user (). login )
92+ logger .info ("authenticated to Github API" )
8493gh_org = gh_instance .get_organization ("MPUSP" )
85- logger .info ("fetching data for organization %s" , gh_org . login )
94+ logger .info ("fetching data for organization" )
8695
8796# get members and their stats
8897members = {}
@@ -123,7 +132,7 @@ def get_config_readme(repo_name):
123132 else None
124133 ),
125134 "contributors" : repo .get_contributors ().totalCount ,
126- "deployments" : repo . get_deployments (). totalCount ,
135+ "deployments" : get_total_deployments ( repo ) ,
127136 "downloads" : sum (
128137 asset .download_count
129138 for release in repo .get_releases ()
0 commit comments