tidyverse / rvest

Simple web scraping for R
https://rvest.tidyverse.org
Other
1.49k stars 341 forks source link

Github Actions Can't Install Dev Version #394

Closed OlexiyPukhov closed 6 months ago

OlexiyPukhov commented 7 months ago

How would I use this in github actions? Trying to get the package two different ways, but they both fail with github actions. I can run it locally with no issue using install_dev(). I'm getting an error with > remotes::install_github("tidyverse/rvest") Error: Error: Failed to install 'rvest' from GitHub: and an error with remotes::install_dev("rvest") Error: Error: Failed to install 'unknown package' from GitHub:

image The url in the picture says: cannot open URL 'https://api.github.com/repos/tidyverse/rvest/contents/DESCRIPTION?ref=HEAD' image

Don't think the Github PAT is the issue here.

The relevant github actions code:

  - name: Install R packages
    run: |
      R -e 'install.packages("remotes", repos = "http://cran.rstudio.com")'
      R -e 'remotes::install_github("tidyverse/rvest")' 
hadley commented 7 months ago

I suspect the failure is happening because the bundled PAT is getting rate limited. I haven't seen this sort of problem for a while, which I suspect is because I'm relying on https://github.com/r-lib/actions/tree/v2-branch/setup-r-dependencies and generally usethis::use_github_action(), which does a bunch of work to setup your action in a way that's most likely to succeed.

OlexiyPukhov commented 7 months ago

I tried putting my PAT in, but it just gave me the same error:

Error: Error: Failed to install 'rvest' from GitHub: can't convert package rvest with RemoteType 'any' to remote Execution halted

The new github actions code that I used:

  - name: Install R packages
    env:
      GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }}
    run: |
      R -e 'install.packages("remotes", repos = "http://cran.rstudio.com")'
      R -e 'Sys.setenv(GITHUB_PAT = Sys.getenv("GITHUB_PAT"))'
      R -e 'remotes::install_github("tidyverse/rvest")'
hadley commented 6 months ago

Can you try using pak instead? That's what we now use for all our github actions.

OlexiyPukhov commented 6 months ago

Okay, I'm using pak and also downloading the most stable version with read html live. It downloads, but I get another error. Making a new issue.