добавлен файл на создание репозитория и библиотеки

This commit is contained in:
Брилин Никита 2026-04-20 17:41:15 +03:00
parent a896be6e66
commit dbf88b714b
5 changed files with 30 additions and 1 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.venv/
__pycache__/
*.pyc
.env

0
gitea_create_comment.py Normal file
View File

25
gitea_create_repo.py Normal file
View File

@ -0,0 +1,25 @@
import os
import requests
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("GITEA_WRITE_TOKEN")
BASE_URL = os.getenv("GITEA_BASE_URL", "https://git.vyatsu.ru")
headers = {
"Authorization": f"token {TOKEN}",
"Content-Type": "application/json"
}
data = {
"name": "third-work-network-python",
"description": "Третья работа по сетевым соединениям в Python",
"private": False,
"auto_init": True
}
response = requests.post(f"{BASE_URL}/api/v1/user/repos", headers=headers, json=data)
print("Статус:", response.status_code)
print(response.json())

View File

@ -11,7 +11,7 @@ headers = {
"Authorization": f"token {TOKEN}" "Authorization": f"token {TOKEN}"
} }
response = requests.get("https://git.vyatsu.ru/api/v1/user", headers=headers) response = requests.get("https://git.vyatsu.ru/stud203989/2zadaniepraktiki/issues/1", headers=headers)
print(response.status_code) print(response.status_code)
print(response.json()) print(response.json())

BIN
requirements.txt Normal file

Binary file not shown.