1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/credential.R
\name{cred_token}
\alias{cred_token}
\title{Create a new personal access token credential object}
\usage{
cred_token(token = "GITHUB_PAT")
}
\arguments{
\item{token}{The name of the environmental variable that holds the
personal access token for the authentication. Default is
\code{GITHUB_PAT}.}
}
\value{
A list of class \code{cred_token} with entry:
\describe{
\item{token}{
The name of the environmental variable that holds
the personal access token for the authentication.
}
}
}
\description{
The personal access token is stored in an envrionmental variable.
Environmental variables can be written to the file
\code{.Renviron}. This file is read by \emph{R} during startup,
see \code{\link[base]{Startup}}. On GitHub, personal access tokens
function like ordinary OAuth access tokens. They can be used
instead of a password for Git over HTTPS, see the \dQuote{Creating
a personal access token} article on GitHub Docs.
}
\examples{
\dontrun{
## Create a personal access token credential object.
## This example assumes that the token is stored in
## the 'GITHUB_PAT' environmental variable.
repo <- repository("git2r")
cred <- cred_token()
push(repo, credentials = cred)
}
}
\seealso{
Other git credential functions:
\code{\link{cred_env}()},
\code{\link{cred_ssh_key}()},
\code{\link{cred_user_pass}()}
}
\concept{git credential functions}
|