forked from Lesin/reposync
34 lines
766 B
Python
34 lines
766 B
Python
import requests
|
|
|
|
# 你的仓库信息
|
|
owner = 'fuxingtamu'
|
|
repo = 'yundingzhiyi'
|
|
|
|
|
|
milestone_title = '测试milestone2'
|
|
due_on = '2024-11-30T00:00:00Z'
|
|
milestone_description = '这是milestone的具体描述'
|
|
|
|
# GitHub创建issue的API URL
|
|
url = f"https://api.github.com/repos/fuxingtamu/yundingzhiyi/milestones"
|
|
|
|
# 构造请求头
|
|
token = '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'
|
|
# 构造请求头
|
|
headers = {
|
|
'Authorization': f'token {token}',
|
|
'Accept': 'application/vnd.github+json'
|
|
}
|
|
|
|
# 发送POST请求
|
|
data = {
|
|
'title': milestone_title,
|
|
'description' : milestone_description,
|
|
'due_on' : due_on
|
|
}
|
|
|
|
response = requests.post(url, headers=headers, json=data,verify=False)
|
|
milestone_info = response.json()
|
|
# 打印响应
|
|
print(milestone_info)
|