From d1c0c4fa3aa6f3ca05775b20be00106da1eaf2c4 Mon Sep 17 00:00:00 2001 From: Nicolas Casajus Date: Thu, 19 Oct 2023 09:43:04 +0200 Subject: [PATCH] ci: update render-readme action --- .github/workflows/render-README.yaml | 14 +++++++++++--- README.Rmd | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/render-README.yaml b/.github/workflows/render-README.yaml index b246c9a..aacf820 100644 --- a/.github/workflows/render-README.yaml +++ b/.github/workflows/render-README.yaml @@ -19,14 +19,22 @@ jobs: fetch-depth: 0 - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-renv@v2 - - name: Render README and Commit Results + - name: Install Rmarkdown + run: Rscript -e 'install.packages("rmarkdown")' + + - name: Render Rmarkdown files run: | RMD_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^README.Rmd$')) - Rscript -e 'rmarkdown::render("README.Rmd")' ${RMD_PATH[*]} + Rscript -e 'for (f in commandArgs(TRUE)) if (file.exists(f)) rmarkdown::render(f)' ${RMD_PATH[*]} + + - name: Commit results + run: | git config --local user.name "$GITHUB_ACTOR" git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - git commit ${RMD_PATH[*]/.Rmd/.md} -m 'doc: render README' || echo "No changes to commit" + git commit README.md -m 'doc: render README' || echo "No changes to commit" git push origin || echo "No changes to commit" diff --git a/README.Rmd b/README.Rmd index 6bc45f2..2dc4df4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -152,7 +152,6 @@ By contributing to this project, you agree to abide by its terms. ## Colophon - This package is the result of intense discussions and feedback from the training course [Reproducible Research in Computational Ecology](https://rdatatoolbox.github.io/).