Skip to contents

A token raises GitHub's limit from 60 to 5,000 requests per hour. A fine-grained token with access to public repositories only reads nothing that is not public: make one at https://github.com/settings/personal-access-tokens/new, choose "Public repositories" under "Repository access", and add no permissions.

Usage

github_pat(pat = NULL)

Arguments

pat

the token to set, or NULL to get the current token

Value

the current token (character; "" when none is set)

Details

Without a token set here, the token is found the way git finds one: the GITHUB_PAT environment variable, else git's credential store (see gitcreds::gitcreds_get()). Store it in your .Renviron file as GITHUB_PAT="your-token" so it is read every time R starts.

Examples

if (FALSE) { # \dontrun{
github_pat()
} # }