Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 29: Update README workflow #60

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ concurrency:
on:
workflow_dispatch:
push:
paths:
- 'README.Rmd'
branches:
- main

jobs:
render-readme:
Expand All @@ -28,17 +28,35 @@ jobs:
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.
extra-packages: any::rmarkdown, local::., any::allcontributors

- name: Update contributors
if: github.ref == 'refs/heads/main'
run: allcontributors::add_contributors(format = "text")
shell: Rscript {0}

- name: Compile the readme
run: |
rmarkdown::render("README.Rmd")
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md man/figures/
git diff-index --quiet HEAD || git commit -m "Automatic readme update [ci skip]"
git push origin || echo "No changes to push"
- name: Upload README.md as an artifact
uses: actions/upload-artifact@v4
with:
name: readme
path: README.md

- name: Create Pull Request
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatic README update"
title: "Update README"
body: "This is an automated pull request to update the README."
branch: "update-readme-${{ github.run_number }}"
labels: "documentation"
reviewers: seabbs
add-paths: |
README.Rmd
README.md
token: ${{ secrets.GITHUB_TOKEN }}
Loading