github_rate_limit {ghclass}R Documentation

Tools for handling GitHub personal access tokens (PAT)

Description

Usage

github_rate_limit()

github_graphql_rate_limit()

github_get_token()

github_set_token(token)

github_reset_token()

github_test_token(token = github_get_token())

github_token_scopes(token = github_get_token())

Arguments

token

Character. Either the literal token, or the path to a file containing the token.

Details

This package looks for the personal access token (PAT) in the following places (in order):

For additional details on creating a GitHub PAT see the usethis vignette on Managing Git(Hub) Credentials. For those who do not wish to read the entire article, the quick start method is to use:

Value

github_get_token() returns the current PAT as a character string with the gh_pat class. See gh::gh_token() for additional details.

github_set_token() and github_reset_token() return the result of Sys.setenv() and Sys.unsetenv() respectively.

github_test_token() invisibly returns a logical value, TRUE if the test passes, FALSE if not.

github_token_scopes() returns a character vector of granted scopes.

Examples

## Not run: 
github_test_token()

github_token_scopes()

(pat = github_get_token())

github_set_token("ghp_BadTokenBadTokenBadTokenBadTokenBadToken")
github_get_token()
github_test_token()

github_set_token(pat)

## End(Not run)


[Package ghclass version 0.3.0 Index]