Skip to content

Commit

Permalink
Merge pull request #117 from github/zkoppert-patch-1
Browse files Browse the repository at this point in the history
enhancement: Check if archived before checking labels and dates for performance
  • Loading branch information
zkoppert authored Apr 19, 2024
2 parents 25fc230 + d928bee commit 1755607
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stale_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def get_inactive_repos(github_connection, inactive_days_threshold, organization)

for repo in repos:
# check if repo is exempt from stale repo check
if repo.archived:
continue
if is_repo_exempt(repo, exempt_repos, exempt_topics):
continue

Expand All @@ -134,7 +136,7 @@ def get_inactive_repos(github_connection, inactive_days_threshold, organization)
active_date_disp = active_date.date().isoformat()
days_inactive = (datetime.now(timezone.utc) - active_date).days
visibility = "private" if repo.private else "public"
if days_inactive > int(inactive_days_threshold) and not repo.archived:
if days_inactive > int(inactive_days_threshold):
inactive_repos.append(
(repo.html_url, days_inactive, active_date_disp, visibility)
)
Expand Down

0 comments on commit 1755607

Please sign in to comment.