From e433af8dd50a258347cb6b425ea9cbee23454a8e Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 14 Jan 2022 16:17:37 -0500 Subject: [PATCH] Add support for allRepos tag Takes a user/github-user-name or an orgs/github-org-name value, and takes all the respositories there. --- README.md | 10 ++++++++++ index.py | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index eecfdff..555d93e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,16 @@ The set of mailing lists, repos / TR documents and events is configured in a JSO ] } ] + }, + "email4@example.com": { + "digest:tuesday": [ + { + "allRepos": "users/githubaccount" + } + { + "allRepos": "orgs/orgname" + } + ] } } ``` diff --git a/index.py b/index.py index 7b29fd0..b9d1eb0 100755 --- a/index.py +++ b/index.py @@ -275,6 +275,15 @@ def getRepoList(source): repos = [] if ("repos" in source): repos = source["repos"] + if ("allRepos" in source): + try: + url = "https://github.com/" + source["allRepos"] + "/repos" + repolist = requests.get(url).json() + repolist = [x.name for x in repolist] + repos = uniq(repos + repolist) + except pass: + # TODO: Bad URL, report error? + if ("repoList" in source): try: repolist = requests.get(source["repoList"]).json()