(
session: aiohttp.ClientSession,
login: str,
repos: list[dict],
)
| 63 | |
| 64 | |
| 65 | async def _discover_emails( |
| 66 | session: aiohttp.ClientSession, |
| 67 | login: str, |
| 68 | repos: list[dict], |
| 69 | ) -> set[str]: |
| 70 | emails: set[str] = set() |
| 71 | for repo in repos[:_COMMIT_REPOS_SAMPLE]: |
| 72 | try: |
| 73 | commits = await _get( |
| 74 | session, |
| 75 | f"{_API_BASE}/repos/{login}/{repo['name']}/commits", |
| 76 | params={"author": login, "per_page": _COMMITS_PER_REPO}, |
| 77 | ) |
| 78 | if not isinstance(commits, list): |
| 79 | continue |
| 80 | for commit in commits: |
| 81 | author = commit.get("commit", {}).get("author", {}) |
| 82 | email = author.get("email", "") |
| 83 | if email and not email.endswith("noreply.github.com"): |
| 84 | emails.add(email) |
| 85 | except Exception: |
| 86 | pass |
| 87 | return emails |
| 88 | |
| 89 | |
| 90 | async def _search_users(session: aiohttp.ClientSession, query: str) -> list[dict]: |
no test coverage detected