From 74a75d3fef872a298e5a1c03a3a151490db510d0 Mon Sep 17 00:00:00 2001 From: Georg Date: Fri, 5 Nov 2021 13:39:31 +0100 Subject: Organization Clone Script Signed-off-by: Georg --- scripts/python/orgclone.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/python/orgclone.py (limited to 'scripts/python') diff --git a/scripts/python/orgclone.py b/scripts/python/orgclone.py new file mode 100644 index 0000000..139d7c5 --- /dev/null +++ b/scripts/python/orgclone.py @@ -0,0 +1,18 @@ +#!/usr/local/bin/python3.8 +import requests +from git import Repo + +organization = 'LibertaCasa' +URL = 'https://git.com.de/api/v1/orgs/' + organization + '/repos' + +response = requests.get( + URL, + headers = {'accept': 'application/json'}, + ) +data = response.json() +repo = [] +for repos in data: + reponame = repos['name'] + repourl = repos['ssh_url'] + print(reponame + ' ' + repourl) + Repo.clone_from(repourl, reponame) -- cgit v1.2.3