Skip to contents

Reads from GitHub's GraphQL API the contributions of user on each day since they joined GitHub, their contributions of each type per year, and their commits per repository and year, one year per query. The API answers any token but none without one.

Usage

collect_contributions(user, token, include_private, include_forks, today)

Arguments

user

GitHub user name.

token

GitHub token, or NULL for the one that gh finds.

include_private, include_forks

Keep the commits in private repositories, and in forks?

today

The day of the collection, the last day kept.

Value

A list with contributions (a data frame of date and count, one row per day), commits (a data frame of year, owner, repo, private, language and commits, one row per repository and year), contribution_types (a data frame of year and the contributions of each type in it: commits, issues, pull_requests, reviews, repositories created and private ones, which the token sees as bare numbers) and joined (the day the user joined GitHub). NULL when the API does not answer a query, as without a token: a part of the contributions would be wrong.

Examples

if (FALSE) { # \dontrun{
contrib <- rghcard:::collect_contributions("octocat", NULL, FALSE, FALSE, Sys.Date())
tail(contrib$contributions)
} # }