Skip to content

Commit 9e2431f

Browse files
committed
fix: failsafe query for deployments
1 parent 1afbff3 commit 9e2431f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/scripts/generate_page.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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+
3241
def get_commit_history(repo):
3342
"""Get commit history for a repository."""
3443
total = get_total_commits(repo)
@@ -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

Comments
 (0)