Skip to content

Commit c6e5fbe

Browse files
authored
fix: catch error that occurs when ghost user made a release. (#367)
* fix: catch error that occurs when ghost user made a release. * erro message like the other similar situations
1 parent 82e379f commit c6e5fbe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stale_repos.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ def get_days_since_last_release(repo):
187187
try:
188188
last_release = next(repo.releases())
189189
return (datetime.now(timezone.utc) - last_release.created_at).days
190+
except TypeError:
191+
print(
192+
f"{repo.html_url} had an exception trying to get the last release.\
193+
Potentially caused by ghost user."
194+
)
195+
return None
190196
except StopIteration:
191197
return None
192198

0 commit comments

Comments
 (0)