usethis::use_github_action("render-readme.yaml") seems specific to r-lib/actions/examples

I expected usethis::use_github_action("render-readme.yaml") to generate a general workflow for anyone to use "out of the box". Instead I get a workflow that specifically renders this file:

Am I supposed to edit the render-readme.yaml? Or is this a "bug".

What works for me is something like this:

      - README.Rmd

name: Render README

    name: Render README
    runs-on: macOS-latest
      - uses: actions/checkout@v1
      - uses: r-lib/actions/setup-r@v1
      - uses: r-lib/actions/setup-pandoc@v1
      - name: Install rmarkdown
        run: Rscript -e 'install.packages("rmarkdown")'
      - name: Render README
        run: Rscript -e 'rmarkdown::render("README.Rmd")'
      - name: Commit results
        run: |
          git add && git commit -m 'Re-build README.Rmd' || echo "No changes to commit"
          git push https://${{}}:${{secrets.GITHUB_TOKEN}}${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit"

My edit:

  • Removes references to the directory examples/;
  • adds git add to account for the case when the repo doesn't have a already;
  • adds output_format = "github_document" to account for the case when README.Rmd lacks such specification in the yaml header.

I'm new to GitHub actions. Can you help me improve this?

If I were you I'd open an issue in :slight_smile:

See also