Bootstrap or Restore renv #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/renv-update.yml | |
| name: Update R dependencies (renv) | |
| on: | |
| schedule: | |
| - cron: "0 6 * * 1" # Mondays at 06:00 UTC | |
| workflow_dispatch: | |
| jobs: | |
| renv-update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: "release" | |
| - name: Install renv | |
| run: Rscript -e 'install.packages("renv", repos="https://cloud.r-project.org")' | |
| - name: Restore library | |
| run: Rscript -e 'renv::restore(prompt = FALSE)' | |
| - name: Update lockfile | |
| run: Rscript -e 'renv::update(); renv::snapshot(prompt = FALSE, force = TRUE)' | |
| - name: Create PR if changed | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| commit-message: "chore(renv): update R dependencies and lockfile" | |
| title: "chore(renv): update R dependencies" | |
| body: "Automated weekly update of R packages via renv." | |
| branch: "chore/renv-update" | |
| labels: dependencies,R | |
| reviewers: diogoribeiro7 | |