r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
332 stars 152 forks source link

`HTTP error 403` error in R studio - unable to execute solution proved in other posts. #764

Closed jon4thin closed 1 year ago

jon4thin commented 1 year ago

I saw that the below solution worked but it is not R code so I do not know how to implement it... What do I have to do so I can run remotes::install_github() in R? My error code is slightly different, it is HTTP error 403.

`API rate limit exceeded for 136.142.159.90. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

Rate limit remaining: 0/60 Rate limit reset at: 2023-07-06 17:23:43 UTC

To increase your GitHub API rate limit

I created the github token with usethis::create_github_token() but i do not know what to do with that token....


          I was able to fix the `HTTP error 401`  on GitHub Actions by defining `GITHUB_PAT` with the job's token:
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

In general it seems that relying on the bundled PAT is not robust. A similar issue was discussed in #330

Originally posted by @jdblischak in https://github.com/r-lib/remotes/issues/638#issuecomment-897741838

jdblischak commented 1 year ago

@jon4thin Checkout the usethis vignette Managing Git(Hub) Credentials for configuring your local development environment to properly authenticate with GitHub

gaborcsardi commented 1 year ago

What @jdblischak said above.

TLDR: run

gitcreds::gitcreds_set()
jon4thin commented 1 year ago

Thanks, sorry! that worked!