Skip to content

Commit d928bee

Browse files
authored
Check if archived before checking labels and dates
Let's not waste time getting info on archived repos just to later bail since its archived. Fail fast.
1 parent 25fc230 commit d928bee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stale_repos.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def get_inactive_repos(github_connection, inactive_days_threshold, organization)
123123

124124
for repo in repos:
125125
# check if repo is exempt from stale repo check
126+
if repo.archived:
127+
continue
126128
if is_repo_exempt(repo, exempt_repos, exempt_topics):
127129
continue
128130

@@ -134,7 +136,7 @@ def get_inactive_repos(github_connection, inactive_days_threshold, organization)
134136
active_date_disp = active_date.date().isoformat()
135137
days_inactive = (datetime.now(timezone.utc) - active_date).days
136138
visibility = "private" if repo.private else "public"
137-
if days_inactive > int(inactive_days_threshold) and not repo.archived:
139+
if days_inactive > int(inactive_days_threshold):
138140
inactive_repos.append(
139141
(repo.html_url, days_inactive, active_date_disp, visibility)
140142
)

0 commit comments

Comments
 (0)