mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-05-06 05:38:50 +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"]
|
||||
release_api_uri = f"{ATOMGIT_API}/repos/{ATOMGIT_OWNER}/{ATOMGIT_REPO}/releases"
|
||||
|
||||
auth_headers = {"Authorization": f"Bearer {access_token}"}
|
||||
release_data = {
|
||||
"access_token": access_token,
|
||||
"tag_name": tag,
|
||||
"name": tag,
|
||||
"body": body,
|
||||
@@ -51,7 +51,9 @@ def sync_to_atomgit(tag, body, files):
|
||||
release_resp = None
|
||||
for attempt in range(3):
|
||||
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()
|
||||
break
|
||||
except requests.exceptions.Timeout:
|
||||
|
||||
Reference in New Issue
Block a user