For unauthenticated requests, the rate limit allows for up to 60 requests per hour. For API requests using Basic Authentication or OAuth, you can make up to 5000 requests per hour. Here we use token to manage this. Obtain a personal access token (PAT) from here: https://github.com/settings/tokens.

pull_github_limit(.token = NULL)

Arguments

.token

Authentication token.

Value

a list.

Details

Typically, you can set GITHUB_PAT variable in your .Renviron file using the following format:

GITHUB_PAT=8c70fd8419398999c9ac5bacf3192882193cadf2

You can also set it in your .Rprofile file using the following format:

Sys.setenv(GITHUB_PAT="8c70fd8419398999c9ac5bacf3192882193cadf2")

For more on what to do with the PAT, see gh::gh_whoami.

Examples

pull_github_limit()
#> { #> "resources": { #> "core": { #> "limit": 5000, #> "used": 43, #> "remaining": 4957, #> "reset": 1606900995 #> }, #> "search": { #> "limit": 30, #> "used": 0, #> "remaining": 30, #> "reset": 1606898399 #> }, #> "graphql": { #> "limit": 5000, #> "used": 0, #> "remaining": 5000, #> "reset": 1606901939 #> }, #> "integration_manifest": { #> "limit": 5000, #> "used": 0, #> "remaining": 5000, #> "reset": 1606901939 #> }, #> "source_import": { #> "limit": 100, #> "used": 0, #> "remaining": 100, #> "reset": 1606898399 #> }, #> "code_scanning_upload": { #> "limit": 500, #> "used": 0, #> "remaining": 500, #> "reset": 1606901939 #> } #> }, #> "rate": { #> "limit": 5000, #> "used": 43, #> "remaining": 4957, #> "reset": 1606900995 #> } #> }