Skip to content

Commit

Permalink
fix: another ghost user error scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed Jul 25, 2024
1 parent 5ff953b commit dbb8538
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions stale_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ def get_active_date(repo):
"""
)
except github3.exceptions.GitHubException:
print(f"{repo.html_url} had an exception trying to get the activity date.")
print(
f"{repo.html_url} had an exception trying to get the activity date.\
Potentially caused by ghost user."
)
return None
return active_date

Expand Down Expand Up @@ -397,9 +400,21 @@ def set_repo_data(
repo_data["days_since_last_pr"] = None
if additional_metrics:
if "release" in additional_metrics:
repo_data["days_since_last_release"] = get_days_since_last_release(repo)
try:
repo_data["days_since_last_release"] = get_days_since_last_release(repo)
except github3.exceptions.GitHubException:
print(
f"{repo.html_url} had an exception trying to get the last release.\
Potentially caused by ghost user."
)
if "pr" in additional_metrics:
repo_data["days_since_last_pr"] = get_days_since_last_pr(repo)
try:
repo_data["days_since_last_pr"] = get_days_since_last_pr(repo)
except github3.exceptions.GitHubException:
print(
f"{repo.html_url} had an exception trying to get the last PR.\
Potentially caused by ghost user."
)

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

0 comments on commit dbb8538

Please sign in to comment.