Create functions for interacting with our Repos

This commit is contained in:
Stewie
2022-04-10 17:37:01 -04:00
parent 41195b43c4
commit 2f642db61a

19
RepoFunctions.py Normal file
View File

@@ -0,0 +1,19 @@
import requests
import json
def get_Releases(org, repo_name, latest=False):
#git_url = "https://api.github.com/repos/SymphoniaLauren/Tales-of-Rebirth/releases"
git_url = "https://api.github.com/repos/{}/{}/releases".format(org, repo_name)
if latest:
git_url = git_url+"/latest"
header = {
"Accept":"application/vnd.github.v3+json"
}
res = requests.get(git_url)
json_res = json.loads(res.text)
return json_res