Error using R markdown with GitHub actions

Hi Jeremy!

I've stumbled upon a similar issue with GHA and {curl} installation.
As pointed out in the link you provided, it seems that this issue might be related to a missing dependency: libcurl.

One possible solution would be to explicitly add a step to install this dependency (I just added a step for this in theyaml file you provided):

on:
  schedule:
    - cron: "35 14 */1 * *" # Every two days at 12:13 AM
    
jobs:
  render-rmarkdown:
    runs-on: ubuntu-latest
    # optionally use a convenient Ubuntu LTS + DVC + CML image
    #container: docker://dvcorg/cml:latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup R
        uses: r-lib/actions/setup-r@v2
      
      - name: Install libcurl
        run: >
          sudo apt-get update && sudo apt-get install --yes
          libcurl4-openssl-dev
          
      - name: Setup dependencies
        run: |
         R -e 'install.packages("remotes")' 
         R -e 'library(remotes)' 
       
      - name: Install system dependencies
        
        if: runner.os == 'Linux'
        run: |
          while read -r cmd
          do
            eval sudo $cmd
          done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
               
      - name: Setup Pandoc
        uses: r-lib/actions/setup-pandoc@v2
        
      - name: Setup renv  
        uses: r-lib/actions/setup-renv@v2
                
      - name: Identify and email 
        #env: 
        #  repo_token: ${{ secrets.GITHUB_TOKEN }} 
        run: |
         Rscript -e 'rmarkdown::render(input = "My_Markdown.Rmd")'
            if [[ "$(git status --porcelain)" != "" ]]; then
            git config --local user.name "$GITHUB_ACTOR"
            git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
            git add *
            git commit -m "Auto update Report"
            git push origin

Hope this helps!


This post was published by an Appsilon) team member. Our company can help you get the most out of RShiny and Posit/RStudio products.

Check our open positions here.

Appsilon: Building impactful RShiny Dashboards and providing R coding services.
Appsilon_GIFsmall_whitebg