mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-05-06 13:48:52 +00:00
fix: use Authorization header instead of access_token in request body for AtomGit API
This commit is contained in:
@@ -39,8 +39,8 @@ def sync_to_atomgit(tag, body, files):
|
|||||||
access_token = os.environ["ATOMGIT_PAT"]
|
access_token = os.environ["ATOMGIT_PAT"]
|
||||||
release_api_uri = f"{ATOMGIT_API}/repos/{ATOMGIT_OWNER}/{ATOMGIT_REPO}/releases"
|
release_api_uri = f"{ATOMGIT_API}/repos/{ATOMGIT_OWNER}/{ATOMGIT_REPO}/releases"
|
||||||
|
|
||||||
|
auth_headers = {"Authorization": f"Bearer {access_token}"}
|
||||||
release_data = {
|
release_data = {
|
||||||
"access_token": access_token,
|
|
||||||
"tag_name": tag,
|
"tag_name": tag,
|
||||||
"name": tag,
|
"name": tag,
|
||||||
"body": body,
|
"body": body,
|
||||||
@@ -51,7 +51,9 @@ def sync_to_atomgit(tag, body, files):
|
|||||||
release_resp = None
|
release_resp = None
|
||||||
for attempt in range(3):
|
for attempt in range(3):
|
||||||
try:
|
try:
|
||||||
release_resp = requests.post(release_api_uri, json=release_data, timeout=30)
|
release_resp = requests.post(
|
||||||
|
release_api_uri, json=release_data, headers=auth_headers, timeout=30
|
||||||
|
)
|
||||||
release_resp.raise_for_status()
|
release_resp.raise_for_status()
|
||||||
break
|
break
|
||||||
except requests.exceptions.Timeout:
|
except requests.exceptions.Timeout:
|
||||||
|
|||||||
Reference in New Issue
Block a user