-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (37 loc) · 1.02 KB
/
R-check-docs.yml
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
on:
push:
branches: [main, master]
pull_request:
name: "Documentation check"
jobs:
docs-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: roxygen2
- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}
- name: Check for changed files
run: |
git add --all
changes=$(git diff-index HEAD --name-only -- man/ NAMESPACE DESCRIPTION)
if [ -n "$changes" ]; then
echo "Changes found after documenting."
git --no-pager diff
echo "$changes"
echo "Please update documentation."
exit 1
else
echo "No changes found after documenting."
exit 0
fi