update for alternate commit format when its just a container update, not the real code commit
This commit is contained in:
@@ -144,11 +144,17 @@ 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
|
||||||
commit_info = response.json()[0]
|
if '0' in response.json():
|
||||||
|
commit_info = response.json()[0]
|
||||||
|
else:
|
||||||
|
commit_info = response.json()
|
||||||
|
|
||||||
# Extract the commit URL and date
|
# Extract the commit URL and date
|
||||||
commit_url = commit_info["html_url"]
|
commit_url = commit_info["html_url"]
|
||||||
commit_date_str = commit_info["commit"]["author"]["date"]
|
if "commit" in commit_info:
|
||||||
|
commit_date_str = commit_info["commit"]["author"]["date"]
|
||||||
|
else:
|
||||||
|
commit_date_str = commit_info["updated_at"]
|
||||||
|
|
||||||
# Convert commit date to datetime object
|
# Convert commit date to datetime object
|
||||||
commit_date = datetime.fromisoformat(commit_date_str.replace('Z', '+00:00'))
|
commit_date = datetime.fromisoformat(commit_date_str.replace('Z', '+00:00'))
|
||||||
|
|||||||
Reference in New Issue
Block a user