MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / query_org_repos

Method query_org_repos

bbot/modules/github_org.py:108–134  ·  view source on GitHub ↗
(self, query)

Source from the content-addressed store, hash-verified

106 )
107
108 async def query_org_repos(self, query):
109 repos = []
110 url = f"{self.base_url}/orgs/{self.helpers.quote(query)}/repos?per_page=100&page=" + "{page}"
111 agen = self.api_page_iter(url, _json=False)
112 try:
113 async for r in agen:
114 if r is None:
115 break
116 status_code = getattr(r, "status_code", 0)
117 if status_code == 403:
118 self.warning("Github is rate-limiting us (HTTP status: 403)")
119 break
120 if status_code != 200:
121 break
122 try:
123 j = r.json()
124 except Exception as e:
125 self.warning(f"Failed to decode JSON for {r.url} (HTTP status: {status_code}): {e}")
126 break
127 if not j:
128 break
129 for item in j:
130 html_url = item.get("html_url", "")
131 repos.append(html_url)
132 finally:
133 await agen.aclose()
134 return repos
135
136 async def query_org_members(self, query):
137 members = []

Callers 1

handle_eventMethod · 0.95

Calls 4

api_page_iterMethod · 0.45
warningMethod · 0.45
jsonMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected