ropensci-review-tools / pkgcheck

Check whether a package is ready for submission to rOpenSci's peer-review system
https://docs.ropensci.org/pkgcheck/
18 stars 6 forks source link

Use same GitHub token logic as gh #153

Open maelle opened 2 years ago

maelle commented 2 years ago

or even the gh function?

Asking this as I am getting a 401.

maelle commented 2 years ago

after getting a 401 for I think an expired GITHUB_GRAPHQL_TOKEN I had in my .Renviron I ran Sys.setenv ("GITHUB_TOKEN" =gh::gh_token()) then got an error about having several tokens. I tried setting GITHUB_GRAPHQL_TOKEN to "" but it did not work so I commented it out in my .Renviron then restarted R then ran Sys.setenv ("GITHUB_TOKEN" =gh::gh_token()) then it worked.

mpadge commented 2 years ago

Yes indeed, that should be done. The reason not is that i don't use the git credentials store, because i have my own wacky encrypted authorization system so i can push to multiple remotes with one command. But my idiosyncracies shouldn't make it more difficult for other people to use this package. I'll update my own workflow, and then get to this straight after that. Thanks!

maelle commented 2 years ago

In that case you'd just need to replace the current function with gh::gh_token().

Now I am curious about your complex workflow, sounds like a good tech note topic. :grin:

mpadge commented 2 years ago

Now I am curious about your complex workflow, sounds like a good tech note topic. grin

No, it's not, and not recommended for anybody else. It was just a fun coding exercise. Also because i like having a pasword prompt after git push. That microsecond delay and mental prompt has saved me from many silly pushes. So my git push works like old-school password-style, but is all 2FA via ssh which shouldn't need a password. It's silly, really, but i like it.