I've setup access to the Github API using a personal access token (PAT) using the credentials
package. This works if I run credentials::set_github_pat()
manually in the console whenever I start a new session. However, I'd like to include this in my .Rprofile so I don't have to do this everytime.
However, this doesn't work for me. Here is the contents of my .Rprofile
cat("Loading custom .Rprofile")
# Load Github API PAT
credentials::set_github_pat(force_new = T, validate = T, verbose = T)
I know .Rprofile is being loaded when starting a new session since cat("Loading custom .Rprofile")
works. But I'm not prompted for my PAT on startup. I still have to run credentials::set_github_pat()
in the console.
Various guides suggest including credentials::set_github_pat()
in .Rprofile, including the credentials vignette.
I'm using RStudio Server v1.1.463, R v3.6.2, and git v2.7.4 on ubuntu 16.04. Credential helper is cache
.
I haven't had any luck finding guidance via search to get this to work. Any ideas on what I'm missing here?
question from:
https://stackoverflow.com/questions/65617442/getting-credentialsset-github-pat-to-work-in-rprofile 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…