Skip to content

Commit d4529df

Browse files
authored
Merge pull request #184 from github/ghost-user-avatar-error
2 parents 5ff953b + dbb8538 commit d4529df

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

stale_repos.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ def get_active_date(repo):
213213
"""
214214
)
215215
except github3.exceptions.GitHubException:
216-
print(f"{repo.html_url} had an exception trying to get the activity date.")
216+
print(
217+
f"{repo.html_url} had an exception trying to get the activity date.\
218+
Potentially caused by ghost user."
219+
)
217220
return None
218221
return active_date
219222

@@ -397,9 +400,21 @@ def set_repo_data(
397400
repo_data["days_since_last_pr"] = None
398401
if additional_metrics:
399402
if "release" in additional_metrics:
400-
repo_data["days_since_last_release"] = get_days_since_last_release(repo)
403+
try:
404+
repo_data["days_since_last_release"] = get_days_since_last_release(repo)
405+
except github3.exceptions.GitHubException:
406+
print(
407+
f"{repo.html_url} had an exception trying to get the last release.\
408+
Potentially caused by ghost user."
409+
)
401410
if "pr" in additional_metrics:
402-
repo_data["days_since_last_pr"] = get_days_since_last_pr(repo)
411+
try:
412+
repo_data["days_since_last_pr"] = get_days_since_last_pr(repo)
413+
except github3.exceptions.GitHubException:
414+
print(
415+
f"{repo.html_url} had an exception trying to get the last PR.\
416+
Potentially caused by ghost user."
417+
)
403418

404419
print(f"{repo.html_url}: {days_inactive} days inactive") # type: ignore
405420
return repo_data

0 commit comments

Comments
 (0)