diff --git a/download_users.py b/download_users.py new file mode 100644 index 0000000..641a0d0 --- /dev/null +++ b/download_users.py @@ -0,0 +1,32 @@ +from github import GitHub +import os +import sys +import json + +ACCESS_TOKEN = os.environ.get("GH_ACCESS_TOKEN", None) +ORG = os.environ.get("GH_ORG", "gsi-upm") + + +gh = GitHub(access_token=ACCESS_TOKEN) + +users = [] + +tfilter = sys.argv[1:] +allteams = gh.orgs(ORG).teams.get() +print(list(t["name"] for t in allteams)) +tlist = list(t for t in allteams if t["name"] in tfilter) +print(tlist) + +for t in tlist: + print("Getting team: %s" % t["name"]) + t["members"] = gh.teams(t["id"]).members.get() + for m in t["members"]: + login = m["login"] + users.append(login) + +with open("userlist", "w") as f: + for user in set(users): + f.write(user) + if user in ("oaraque", "balkian", "cif2cif"): + f.write(" admin") + f.write("\n") diff --git a/userlist b/userlist index c0aeb58..230f8e3 100644 --- a/userlist +++ b/userlist @@ -1,36 +1,21 @@ -balkian admin -cif2cif admin -nachtkatze admin -adri87 -AlbertoED -alejandroSaura -allopezf -alvarocarrera -amardomingo -antoniom-diaz -arturomtm -Batlin -carloscrespog -constanr -DanielLara -dmorenob +jochoaserna +SergioML9 emilioserra -enriquecs -gpoveda -gsi-bot -hopple -javiherrera -JesusMSM -Krun -ladvan -miguelcb84 -mtorresl +oaraque admin +Drozzer +constanr +antoniom-diaz +Lorena25 NachoCP -neburdv -neoner2002 -pmoncadaisla -RBermejo -rmaestre -rongil +rodbarest +alvarocarrera +gpoveda +hopple +AlbertoED sunshengjing -toniprada +balkian admin +pepos +antoniofll +enriquecs +miguelcb84 +JesusMSM