GHA failing to download dev versions of packages with utils::download.file()

I'm getting a similar error on multiple sites that are building using Github Actions whenever it tries to install a development version of a package using {remotes}. Here's an example error message:

Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/hadley/emo/contents/DESCRIPTION?ref=HEAD'

If you go to the url provided, it exists, so I'm not sure why it can't open it. Here's the log:

https://github.com/jhelvy/jhelvy.com/runs/3373868709?check_suite_focus=true

After some trial and error, it looks like the issue had to do with permissions.

I didn't have the GITHUB_TOKEN in my config - added this under env and now everything works.

jobs:
  build:
    runs-on: macOS-latest
    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.