Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do something about GITHUB_PAT=ajskdfjlskflsksdlfkj in .Renviron #1488

Closed
jennybc opened this issue Sep 17, 2021 · 1 comment
Closed

Do something about GITHUB_PAT=ajskdfjlskflsksdlfkj in .Renviron #1488

jennybc opened this issue Sep 17, 2021 · 1 comment
Labels
git git, GitHub, and CI in general

Comments

@jennybc
Copy link
Member

jennybc commented Sep 17, 2021

Many people dutifully follow the advice to get a new PAT and put it into the Git credential store with gitcreds.

But then they still get error messages about an invalid PAT!

A very common reason is that they still have an old PAT in .Renviron that is masking the new one, i.e. preventing gitcreds from going into the store.

This is very near the top of our article Managing Git(Hub) Credentials:

If you have previously set your GitHub PAT in .Renviron, stop doing that.

and again later:

If you have previously made your GitHub PAT available by setting the GITHUB_PAT environment variable in .Renviron, you need to actively stop doing that.

and a detailed footnote:

If you have any doubt about your previous practices, open .Renviron, look for any line setting the GITHUB_PAT environment variable, and delete it. usethis::edit_r_environ() can be helpful for getting .Renviron open for editing. Don’t forget to restart R for this change to take effect.

but quite a few users still miss this point.

git_sitrep() should probably help to surface that GITHUB_PAT is being set in .Renviron. Once someone is frustrated and troubleshooting, maybe a hint in git_sitrep() would be enough to allow them to diagnose and solve the problem.

@jennybc jennybc added the git git, GitHub, and CI in general label Sep 17, 2021
@jennybc jennybc added this to the v2.1.0 milestone Sep 28, 2021
@jennybc jennybc closed this as completed in 1824405 Oct 2, 2021
@AmeliaMN
Copy link

Just ran into this again and the updated version of usethis saved me. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git git, GitHub, and CI in general
Projects
None yet
Development

No branches or pull requests

2 participants