-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgithub_helper.py
37 lines (35 loc) · 1.26 KB
/
github_helper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import requests
import os
import dotenv
from dotenv import load_dotenv
from github import Github
load_dotenv()
def new_stable_release(version, commit_hash):
print("starting a new stable release for version=", version)
"""
Send
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/BerriAI/litellm/actions/workflows/ghcr_deploy.yml/dispatches" \
-d "{\"ref\":\"main\", \"inputs\":{\"tag\":\"v${VERSION}\"}}"
"""
pass
# new_version_name = f"v{version}-stable"
# response = requests.post(
# "https://api.github.com/repos/BerriAI/litellm/actions/workflows/ghcr_deploy.yml/dispatches",
# headers={
# "Accept": "application/vnd.github.v3+json",
# "Authorization": f"Bearer {os.getenv('GITHUB_TOKEN')}",
# },
# json={"ref": "main", "inputs":
# {
# "tag": new_version_name,
# "commit_hash": commit_hash,
# "release_type": "stable"
# }
# },
# )
# print("response: ", response)
# print("response.text: ", response.text)
# print("response.status_code: ", response.status_code)