forked from Lesin/reposync
32 lines
692 B
Python
32 lines
692 B
Python
import requests
|
||
import json
|
||
|
||
# 你的GitHub用户名(或用于认证的token)
|
||
# 注意:出于安全考虑,通常不建议在代码中硬编码密码,而是使用token
|
||
|
||
# 你的仓库信息
|
||
owner = 'fuxingtamu'
|
||
repo = 'yundingzhiyi'
|
||
|
||
|
||
|
||
# GitHub创建issue的API URL
|
||
url = f"https://api.github.com/repos/fuxingtamu/yundingzhiyi/issues/255"
|
||
|
||
# 构造请求头
|
||
token = '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'
|
||
# 构造请求头
|
||
headers = {
|
||
'Authorization': f'token {token}',
|
||
'Accept': 'application/vnd.github+json'
|
||
}
|
||
|
||
# 发送POST请求
|
||
data = {
|
||
"state":'open'
|
||
}
|
||
|
||
response = requests.patch(url, headers=headers, json=data,verify=False)
|
||
# 打印响应
|
||
print(response.text)
|