Closed pwildenhain closed 6 years ago
Hi,
It is strange as I never noticed that. I have a token set in GITHUB_PAT
(checked with gh::gh_whoami()
) and I can install using devtools::install_github("ijlyttle/ghentr")
. The GITHUB_PAT should not prevent getting a public repo.
Out of curiosity, some question to understand:
ghentr
help for thatIn all case, I am curious to understand the issue.
Is it a github.com token or a Github Entreprise Token ? Normally, GHE token should be put in an env variable with a different name.
ghentr
help for that
This might be our problem. It's an enterprise token. Should we create new enterprise tokens using ghentr
?
Thanks @cderv for jumping in - I think you are getting at the heart of the issue.
@pwildenhain Thanks for your kind words, let me see if I can bounce off of Christophe's advice:
Your environment variable called GITHUB_PAT
should be a PAT issued by github.com, if GITHUB_PAT
is a PAT from your GHE, this would cause the error you reported.
Let's say that you work at Acme, Inc., you might use ghentr::use_github_enterprise()
to create a function maybe called acmetools::install_github_acme()
. This function would expect an environment variable called GITHUB_ACME_PAT
, which you would get from your GHE instance.
Hope this helps!
Thanks for clearing this up!
Terrific package! Our organization is just starting to embrace R and something like this is definitely the next step for us.
In the READme, the instructions to install are:
However, if you have a
GITHUB_PAT
in your environment, then R will try to pass your token and this will throw an error:Installation failed: Bad credentials (401)
Since the primary audience for this package are those of us who are already using Github Enterprise, and most of us have already set up a
GITHUB_PAT
token, can we change the installation instructions to: