import requests
import os

TOKEN = os.getenv("GITEA_TOKEN")

if not TOKEN:
    print("Токен не найден")
    exit()

headers = {
    "Authorization": f"token {TOKEN}",
    "Content-Type": "application/json"
}


OWNER = "stud203989"
REPO = "2zadaniepraktiki"

data = {
    "title": "Тестовое issue",
    "body": "Создано через API"
}

url = f"https://git.vyatsu.ru/api/v1/repos/{OWNER}/{REPO}/issues"

response = requests.post(url, headers=headers, json=data)

print(response.status_code)
print(response.text)