OTA committed for troubleshooting
This commit is contained in:
6
ota.py
6
ota.py
@@ -155,16 +155,12 @@ def _fetch_commit_sha():
|
|||||||
f"{GITEA_BASE}/api/v1/repos/{REPO_OWNER}/{REPO_NAME}"
|
f"{GITEA_BASE}/api/v1/repos/{REPO_OWNER}/{REPO_NAME}"
|
||||||
f"/branches/{REPO_BRANCH}"
|
f"/branches/{REPO_BRANCH}"
|
||||||
)
|
)
|
||||||
info(f"Fetching commit from {url}")
|
|
||||||
try:
|
try:
|
||||||
r = urequests.get(url, headers=_headers())
|
r = urequests.get(url, headers=_headers())
|
||||||
info(f"Response status: {r.status_code}")
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
data = r.json()
|
data = r.json()
|
||||||
r.close()
|
r.close()
|
||||||
sha = data.get("commit", {}).get("sha")
|
return data.get("commit", {}).get("id")
|
||||||
info(f"Got commit: {sha}")
|
|
||||||
return sha
|
|
||||||
r.close()
|
r.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log_err(f"Failed to fetch commit: {e}")
|
log_err(f"Failed to fetch commit: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user