Refactor GitHub commit fetching logic

This commit is contained in:
Hoang Hong Quan
2025-08-30 14:21:10 +07:00
parent 50e3226209
commit e6da36db94
2 changed files with 31 additions and 20 deletions

View File

@@ -34,14 +34,11 @@ class Updater:
def get_latest_sha_version(self):
print("Fetching latest version from GitHub...")
try:
latest_commit = self.github.get_latest_commit("lzhoang2801", "OpCore-Simplify")
if latest_commit and latest_commit.get("sha"):
return latest_commit.get("sha")
commits = self.github.get_commits("lzhoang2801", "OpCore-Simplify")
return commits["commitGroups"][0]["commits"][0]["oid"]
except Exception as e:
print("Error fetching latest SHA version: {}".format(str(e)))
return None
print("Could not fetch latest commit information from GitHub.")
return None
def download_update(self):