21 lines
348 B
Python
21 lines
348 B
Python
import os
|
|
import requests
|
|
|
|
TOKEN = os.getenv("GITEA_TOKEN")
|
|
|
|
if not TOKEN:
|
|
print("Токен не найден")
|
|
raise SystemExit(1)
|
|
|
|
headers = {
|
|
"Authorization": f"token {TOKEN}"
|
|
}
|
|
|
|
response = requests.get(
|
|
"https://git.vyatsu.ru/api/v1/user",
|
|
headers=headers,
|
|
timeout=10
|
|
)
|
|
|
|
print(response.status_code)
|
|
print(response.text) |