Update the script based on the SHA of each commit

This commit is contained in:
Hoang Hong Quan
2024-08-18 12:07:03 +07:00
parent 768e67898d
commit f4b8035da1
3 changed files with 41 additions and 22 deletions

View File

@@ -19,6 +19,15 @@ class Github:
if response.get("rate").get("remaining") == 0:
raise Exception("Please try again later, you have exhausted your GitHub REST API request quota")
def get_latest_commit(self, owner, repo):
self.check_ratelimit()
url = "https://api.github.com/repos/{}/{}/commits".format(owner, repo)
response = self.fetcher.fetch_and_parse_content(url, "json")
return response[0]
def get_latest_artifact(self, owner, repo):
results = []