This commit is contained in:
2025-11-10 11:28:22 +01:00
parent 13503619a8
commit 3ce513a4b3

View File

@@ -12,9 +12,21 @@ import hashlib
import json import json
import datetime import datetime
import shutil import shutil
import subprocess
logging.basicConfig(level=logging.INFO, format='%(asctime)s - Thread %(threadName)s - %(message)s') logging.basicConfig(level=logging.INFO, format='%(asctime)s - Thread %(threadName)s - %(message)s')
# Update the local repository via git pull before proceeding
try:
subprocess.run(['git', 'pull'], check=True, capture_output=True)
logging.info("Updated repo via git pull")
except subprocess.CalledProcessError as e:
logging.warning(f"Git pull failed (non-zero exit): {e}")
except FileNotFoundError:
logging.warning("Git not found; skipping pull")
except Exception as e:
logging.warning(f"Unexpected error during git pull: {e}")
api_base = "https://nachos386.lcube-server.de/api/v1" api_base = "https://nachos386.lcube-server.de/api/v1"
def fetch_release_info(repo_owner, repo_name): def fetch_release_info(repo_owner, repo_name):
@@ -41,7 +53,6 @@ def fetch_release_info(repo_owner, repo_name):
hash_value = None hash_value = None
# For compatibility, check if 'digest' exists (unlikely in Gitea) # For compatibility, check if 'digest' exists (unlikely in Gitea)
digest = asset.get('digest', '') digest = asset.get('digest', '')
print(asset)
if digest and digest.startswith('sha256:'): if digest and digest.startswith('sha256:'):
hash_value = digest[7:].lower() hash_value = digest[7:].lower()
logging.info(f"Fetched hash for {filename}: {hash_value[:16]}...") logging.info(f"Fetched hash for {filename}: {hash_value[:16]}...")