gh_pat: Retrieve GitHub personal access token.

Description Usage Arguments Details Value Examples

Description

Consults environment variables for a GitHub personal access token (PAT). By default, looks for GITHUB_PAT and GITHUB_TOKEN, in that order. Conventions followed by other packages at the time of writing: git2r and devtools look for GITHUB_PAT, gh looks for GITHUB_TOKEN. Obtain a PAT from https://github.com/settings/tokens. Unless you have a specific reason to request otherwise, the default scopes are probably sufficient.

Usage

1
gh_pat(envvar = c("GITHUB_PAT", "GITHUB_TOKEN"))

Arguments

envvar

Name of the environment variable in which the GitHub personal access token is stored. Can be a character vector, with names in order of preference.

Details

How to store your PAT in an environment variable?

Value

The GitHub personal access token, invisibly.

Examples

1
2
3
4
5
## by default, the PAT is not printed to screen
gh_pat()

## if you really want to see it, surround the call with extra parentheses
(gh_pat())

jennybc/githug documentation built on May 19, 2019, 5:05 a.m.