I am having issues verifying a PAT while using GitHub enterprise. I have the PAT stored in a GITHUB_PAT environment variable.
# host replaced with enterprise name
use_github(host = "https://github.hostname.com/api/v3")
# > Error: GitHub `auth_token` is invalid.
# > See `browse_github_token()` for help storing a token as an environment variable.
Using traceback() and debugging, I see the error stems from usethis:::check_github_token(auth_token) and a call to gh::gh_whoami(auth_token) that is returning an error.
When I explicitly use gh::gh_whoami(.api_url = "https://github.hostname.com/api/v3") it returns a list as expected like this:
{
"name": "Greg",
"login": "USERNAME",
"html_url": "https://github.hostname.com/USERNAME",
"scopes": "gist, repo",
"token": "2d..."
}
I can't seem to figure out the proper way to pass my host URL so that the check for my GitHub token passes successfully.
If anyone has insight into what is going on it would be greatly appreciated!
Thanks,
Greg