-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
When I run the following code in the github_repos chunk:
s_ghn <- safely(gh_next) # API calls are fraught with peril, so make this one a bit safer
my_repos_file <- file.path(rt, "data", "my_repos.rds")
if (!file.exists(my_repos_file)) {
curr_repo <- gh("/user/repos", username = "public")
my_repos <- list()
i <- 1
my_repos[i] <- list(curr_repo)
spin <- TRUE
while(spin) {
curr_repo <- s_ghn(curr_repo)
if (is.null(curr_repo$result)) break
i <- i + 1
curr_repo <- curr_repo$result
my_repos[i] <- list(curr_repo)
}
my_repos <- unlist(my_repos, recursive=FALSE)
write_rds(my_repos, my_repos_file)
} else {
my_repos <- read_rds(my_repos_file)
}
The following error is returned:
Error in gh("/user/repos", username = "public") :
GitHub API error (401): 401 Unauthorized
Requires authentication
I checked on a few ways to authenticate but could not find out how to authenticate with GitHub. Is there a separate step (through GitHub - or locally) that needs to be done before running this?
Thank you for sharing this awesome resource!
Reactions are currently unavailable