Skip to content

Commit

Permalink
ci: update render-readme action
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Oct 19, 2023
1 parent c43b895 commit d1c0c4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/render-README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 0 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down

0 comments on commit d1c0c4f

Please sign in to comment.