fetch_repo_data.ts view source
(options: FetchRepoDataOptions): Promise<RepoJson[]> import {fetch_repo_data} from '@fuzdev/fuz_repos/fetch_repo_data.js'; Fetches GitHub metadata (CI status, PRs) for all repos.
Fetches sequentially with a delay before each request to respect GitHub API
rate limits. Uses await_in_loop intentionally to avoid parallel requests
overwhelming the API. CI status is read for the branch each repo's registry
entry follows (main when it names none), and that branch is written to
RepoJson.branch.
A repo whose registry entry declares no CI (ci: false) isn't asked for
check runs, and one with none on its branch isn't a failure: both leave
check_runs null without logging. A failed fetch is logged as an error
and leaves null for that repo's check_runs or pull_requests, and the
remaining repos still fetch — except a 401 response or a repo URL without a
GitHub owner, which throw.
options
the repos, credentials, cache, and pacing
returns
Promise<RepoJson[]>
a RepoJson for each repo, in the order given
throws
Error- on a 401 response (check `SECRET_GITHUB_API_TOKEN`) or a repo whose URL has no GitHub owner