29 lines
760 B
Python
29 lines
760 B
Python
import os
|
|
import sys
|
|
import requests
|
|
|
|
token = os.environ.get("GITEA_TOKEN")
|
|
if not token:
|
|
print("ERROR: GITEA_TOKEN not set", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
url = "https://gitea.hmac.kr/api/v1/repos/Kyeongmin/C.E.L_Slide_test2/issues/21/comments"
|
|
draft_path = r"D:\ad-hoc\kei\design_agent\.orchestrator\drafts\21_stage_test-verify_claude_r1.md"
|
|
|
|
with open(draft_path, "r", encoding="utf-8") as f:
|
|
body = f.read()
|
|
|
|
resp = requests.post(
|
|
url,
|
|
headers={"Authorization": f"token {token}"},
|
|
json={"body": body},
|
|
timeout=60,
|
|
)
|
|
print(f"STATUS={resp.status_code}")
|
|
if resp.status_code in (200, 201):
|
|
data = resp.json()
|
|
print(f"ID={data.get('id')}")
|
|
print(f"URL={data.get('html_url')}")
|
|
else:
|
|
print(f"BODY={resp.text[:500]}")
|