OTA committed for troubleshooting

This commit is contained in:
2026-04-06 12:20:58 +02:00
parent 53f3b026c6
commit 4ccda8b764

6
ota.py
View File

@@ -155,16 +155,12 @@ def _fetch_commit_sha():
f"{GITEA_BASE}/api/v1/repos/{REPO_OWNER}/{REPO_NAME}"
f"/branches/{REPO_BRANCH}"
)
info(f"Fetching commit from {url}")
try:
r = urequests.get(url, headers=_headers())
info(f"Response status: {r.status_code}")
if r.status_code == 200:
data = r.json()
r.close()
sha = data.get("commit", {}).get("sha")
info(f"Got commit: {sha}")
return sha
return data.get("commit", {}).get("id")
r.close()
except Exception as e:
log_err(f"Failed to fetch commit: {e}")