fix: use Authorization header instead of access_token in request body for AtomGit API

This commit is contained in:
naiba
2026-02-16 13:42:26 +08:00
parent d9e05e594a
commit 6d2a12b7a4
+4 -2
View File
@@ -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: