handle differing output formats

This commit is contained in:
2025-12-11 21:59:14 +11:00
parent 2be3859825
commit e2aeec7c07

View File

@@ -144,10 +144,11 @@ def GetLastCommmitDaysAgo( container ):
# Fetch the latest commit details from GitHub API # Fetch the latest commit details from GitHub API
response = requests.get(m[1]) response = requests.get(m[1])
response.raise_for_status() # Raise an error for bad status codes response.raise_for_status() # Raise an error for bad status codes
if '0' in response.json(): tmp_resp = response.json()
commit_info = response.json()[0] if isinstance(tmp_resp, list):
commit_info = tmp_resp[0]
else: else:
commit_info = response.json() commit_info = tmp_resp
# Extract the commit URL and date # Extract the commit URL and date
commit_url = commit_info["html_url"] commit_url = commit_info["html_url"]