From ac12d691a90654404c21818cdf1a46dffcb1b98e Mon Sep 17 00:00:00 2001 From: Louis BEAUJOIN Date: Mon, 15 Jun 2026 12:20:08 +0200 Subject: [PATCH] Ajout du script de creation de depot via API --- create_repo.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 create_repo.py diff --git a/create_repo.py b/create_repo.py new file mode 100644 index 0000000..b2c9cad --- /dev/null +++ b/create_repo.py @@ -0,0 +1,21 @@ +import requests + +TOKEN = "TON_TOKEN_API" +URL = "https://forge.gwenaelremond.fr/api/v1/user/repos" + +headers = { + "Authorization": f"token {TOKEN}", + "Content-Type": "application/json", + "accept": "application/json" +} + +data = { + "name": "exercice", + "description": "Mon depot exercice API", + "auto_init": True, + "private": False +} + +response = requests.post(URL, headers=headers, json=data) +print(response.status_code) +print(response.json())