-
Notifications
You must be signed in to change notification settings - Fork 434
48 lines (46 loc) · 1.51 KB
/
UpdateRefs.yml
File metadata and controls
48 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: UpdateRefs
on:
schedule:
- cron: '00 00 * * 00'
workflow_dispatch:
jobs:
UpdateRefs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: r-lib/actions/setup-r@v2
with:
r-version: '4'
- uses: r-lib/actions/setup-renv@v2
with:
working-directory: 'test/refs'
- name: Update renv
run: renv::update()
shell: Rscript {0}
working-directory: test/ref
- name: Check for changes of R environment
id: check
shell: bash
run: |
output=$(git diff --name-only -- test/ref)
if [ "$output" != "" ]; then
>&1 echo "The R environment was updated"
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Regenerate references
if: steps.check.outputs.changed
run: Rscript gendref.R
working-directory: test/ref
- name: Create pull request
if: steps.check.outputs.changed
uses: peter-evans/create-pull-request@7
with:
token: ${{ secrets.DOCUMENTER_KEY }}
commit-message: "🤖 Automatic update of R references"
title: "🤖 Automatic update of R references"
body: |-
This pull request updates all packages and references in the `test/ref` directory.
delete-branch: true
add-paths: test/ref