Skip to content

Commit

Permalink
add print at the end
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed May 23, 2023
1 parent 182004a commit 30f6449
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stale_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main():
instance instead of github.com.
"""
print("Starting stale repo search...")

# Load env variables from file
dotenv_path = join(dirname(__file__), ".env")
load_dotenv(dotenv_path)
Expand Down Expand Up @@ -56,14 +56,17 @@ def main():

# Iterate over repos in the org, acquire inactive days,
# and print out the repo url and days inactive if it's over the threshold (inactive_days)
inactive_repos = []
for repo in github_connection.repositories_by(organization):
last_push_str = repo.pushed_at # type: ignore
if last_push_str is None:
continue
last_push = parse(last_push_str)
days_inactive = (datetime.now() - last_push).days
if days_inactive > int(inactive_days_threshold):
inactive_repos.append((repo, days_inactive))
print(f"{repo.html_url}: {days_inactive} days inactive") # type: ignore
print(f"Found {len(inactive_repos)} stale repos in {organization}")


if __name__ == "__main__":
Expand Down

0 comments on commit 30f6449

Please sign in to comment.