Description Usage Arguments Details Value Examples
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.
1 |
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. |
How to store your PAT in an environment variable?
Identify your home directory. Not sure? Enter
normalizePath("~/")
in the R console.
If you don't already have a file here named .Renviron
, create
one. If you have one already, open it for editing.
Add a line like this: GITHUB_PAT=blahblahblahblahblahblah
, where
blahblahblahblahblahblah
is your PAT. Make sure the last line in the
file is empty. Otherwise R will silently fail to load the file.
Save. And yes you do want to use a filename that begins with a dot.
Restart R. .Renviron
is processed only during
Startup
.
Check your work with Sys.getenv("GITHUB_PAT")
. Your PAT should
print to screen.
The GitHub personal access token, invisibly.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.