From 4d9b9e6ace80e69a106190a64d7a0b1ba6491a84 Mon Sep 17 00:00:00 2001 From: kasimeka Date: Tue, 27 May 2025 13:23:54 +0300 Subject: [PATCH] feat(update_mod_versions.py): add support for `last-updated` field --- .github/scripts/update_mod_versions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/update_mod_versions.py b/.github/scripts/update_mod_versions.py index 6b577d70..6f049dfe 100755 --- a/.github/scripts/update_mod_versions.py +++ b/.github/scripts/update_mod_versions.py @@ -15,6 +15,8 @@ import requests GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN') HEADERS = {'Authorization': f'token {GITHUB_TOKEN}'} if GITHUB_TOKEN else {} +TIME_NOW = int(time.time()) + def extract_repo_info(repo_url): """Extract owner and repo name from GitHub repo URL.""" match = re.search(r'github\.com/([^/]+)/([^/]+)', repo_url) @@ -190,6 +192,7 @@ def process_mod(start_timestamp, name, meta_file): f"✅ Updating {name} from {current_version} to {new_version} ({source})" ) meta['version'] = new_version + meta['last-updated'] = TIME_NOW if "/archive/refs/tags/" in download_url: meta['downloadURL'] = f"{repo_url}/archive/refs/tags/{meta['version']}.zip"