Add a cutoff period before archiving

This commit is contained in:
bbhtt
2024-07-10 17:46:15 +05:30
parent ec0a36a006
commit 3cddb151fb
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -1,3 +1,4 @@
import datetime
import os
import subprocess
import time
@@ -90,8 +91,12 @@ def main() -> None:
refname = eols[count]
try:
repo = g.get_repo(f"flathub/{refname}")
if not repo.archived:
print("Archiving {}".format(repo.html_url))
if not repo.archived and repo.pushed_at < earliest:
print(
"Archiving: {}. Repo is in EOL list. Last push: {}, earlier than: {}".format(
repo.html_url, repo.pushed_at.isoformat(), earliest.isoformat()
)
)
repo.edit(archived=True)
except UnknownObjectException:
pass
+1 -1
View File
@@ -2,7 +2,7 @@ name: Archive EOL repositories
on:
schedule:
- cron: '0 14 * * 1'
- cron: '0 0 1 * *'
workflow_dispatch: {}
jobs: