fetchContributedTo
The fetcher behind the contributed-to card.
Rank the repositories a user has contributed to, most contributions first.
from and to narrow the walk to the range they name,
so the ranking, the totals and the year marks all cover that range and nothing else.
A range the account contributed in no year of draws an empty card rather than an error.
Ties keep the walk's order, which is chronological: the repository first seen in the earliest range comes first.
An excluded repository is dropped before the total is counted, so the footer's "top n of m" never counts one the card was told not to show.
fetchContributedTo(options, config: CardConfig): Promise<ContributedToData>| Option | Type | Required | What it is |
|---|---|---|---|
username | string | undefined | yes | — |
include_own_repos | boolean | undefined | no | — |
repos_count | number | undefined | no | Rows to rank; out of range or unparsed, the default stands. |
exclude_repo | string[] | undefined | no | Each entry is an owner/name or a bare name. |
from | Date | undefined | no | Start of the range to walk; as early as GitHub goes when absent. |
to | Date | undefined | no | End of that range. |
Returns Promise<ContributedToData> — The ranked slice, and the totals it was taken from.
The range
Section titled “The range”Both ends are inclusive, and an omitted end is filled with the widest range GitHub will answer
for. A contributionsCollection spans at most a year, so the range is sliced into one per
calendar year and the slices are sent as fields of a single request — one rate-limit point for the
whole span rather than one per year.
Ordering
Section titled “Ordering”Repositories come back most-contributions-first, with the years each one saw.
repos_count caps the list; include_own_repos decides whether the user’s own repositories are in
it at all, and they are not by default.