Description Usage Arguments Details Value See Also Examples
Initialize a Travis-CI API token
1 2 3 4 | auth_travis(username, password, setenv = TRUE, clean = !missing(username),
force = FALSE, gh_token = c(Sys.getenv("GITHUB_TOKEN"),
Sys.getenv("GITHUB_PAT")), base = c("https://api.travis-ci.org",
"https://api.travis-ci.com"))
|
username |
A character string containing a GitHub username. |
password |
A character string containing a GitHub password for account |
setenv |
A logical indicating whether to set the TRAVIS_CI_TOKEN environment variable. If |
clean |
A logical specifying whether to delete the temporarily generated GitHub personal access token from the GitHub account. Deafult is |
force |
A logical indicating whether to force the operation and override an already stored value in TRAVIS_CI_TOKEN. |
gh_token |
An optional character string specifying a GitHub personal access token. This is ignored if |
base |
A character string specifying the base URL for the API. By default this is https://api.travis-ci.org, but may need to be changed if using a Travis Pro or enterprise account. |
Using the Travis-CI API requires an API token (see API documentation for details). This function implements a sort of handshake that uses a GitHub personal access token to generate a Travis token (to store in an environment variable, TRAVIS_CI_TOKEN) or, alternatively, uses a GitHub username and password pair to generate such a token, conduct the handshake, and then cleanup the generated, temporary token. The easiest way to use the function is to set the GITHUB_TOKEN and GITHUB_PAT environment variables, then simply call auth_travis()
with no arguments, but see examples.
A character string containing the Travis-CI API token, invisibly.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
# authenticate using GitHub login credentials
auth_travis("username", "password")
# authenticate using a GitHub personal access token
auth_travis(gh_token = "example token")
# set GITHUB_TOKEN environment variable to authenticate
Sys.setenv("GITHUB_TOKEN" = "example token")
auth_travis()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.