repro icon indicating copy to clipboard operation
repro copied to clipboard

Problems with generating a GitHub token with repro::check_github_token()

Open rsjouwerman opened this issue 4 years ago • 2 comments
trafficstars

Hi Aaron,

I'm preparing for the workshop next week and I'm struggling with the last prep step. When running: repro::check_github() R stops responding. Same with: repro::check_github_ssh().

I tried to generate a token with repro::check_github_token() and added this token with gitcreds::gitcreds_set(). When re-running repro::check_github_token() however, R tells me I don't have a GitHub token.

Then I ran usethis::gh_token_help(), which told me that a personal access token was discovered. And I see info on my token when running gh::gh_whoami().

I'm confused why repro::check_github_token() tells me I don't have a token? Am I missing a step here? Thanks for your help.

Rachel

rsjouwerman avatar Mar 26 '21 10:03 rsjouwerman

Hey Rachel, it sounds like you did everything flawlessly! repro checks under the hood with:

repro:::has_github_token_
#> function()gh::gh_token() != ""
#> <bytecode: 0x1af0d40>
#> <environment: namespace:repro>

Created on 2021-03-26 by the reprex package (v1.0.0)

If you get or similar:

usethis::gh_token_help()
#> ● GitHub host: 'https://github.com'
#> ● Host online: TRUE
#> ● Personal access token for 'https://github.com': '<discovered>'
#> ℹ Call `gh::gh_whoami()` to see info about your token, e.g. the associated user
#> ℹ To see or update the token, call `gitcreds::gitcreds_set()`
#> ✓ If those results are OK, you are good go to!
#> ℹ Read more in the 'Managing Git(Hub) Credentials' article:
#>   https://usethis.r-lib.org/articles/articles/git-credentials.html

Created on 2021-03-26 by the reprex package (v1.0.0)

Then I would trust that everything works, regardless of what repro tells you. Still, I am curious to find out what is going wrong; maybe we have some time at the workshop to investigate.

aaronpeikert avatar Mar 26 '21 11:03 aaronpeikert

Hi Aaron,

thanks for your quick reply. Yes, that's exactly what I get. Sounds good -- Looking forward to next week! Thanks again, Rachel

rsjouwerman avatar Mar 26 '21 11:03 rsjouwerman