powered by
github_get_token - returns the user's GitHub personal access token (PAT).
github_get_token
github_set_token - defines the user's GitHub PAT by setting the GITHUB_PAT environmental variable. This value can then
github_set_token
GITHUB_PAT
github_reset_token - removes the value stored in the GITHUB_PAT environmental variable.
github_reset_token
github_test_token - checks if a PAT is valid by attempting to authenticate with the GitHub API
github_test_token
github_get_token()github_set_token(token)github_reset_token()github_test_token(token = github_get_token())
github_set_token(token)
github_reset_token()
github_test_token(token = github_get_token())
Character. Either the literal token path, or the path to a file containing the token.
This package looks for the personal access token (PAT) in the following places (in order):
Value of GITHUB_PAT environmental variable.
Value of GITHUB_TOKEN environmental variable.
GITHUB_TOKEN
Contents of ~/.github/token file.
~/.github/token
# NOT RUN { github_test_token() pat = github_get_token() github_set_token("bad_token") github_test_token() github_set_token(pat) # } # NOT RUN { # }
Run the code above in your browser using DataLab