-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.56 KB
/
document.yaml
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
49
50
51
52
53
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
workflow_call:
inputs:
branch_name:
type: string
required: true
jobs:
document:
name: 📖 Document
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Configure git
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git switch ${{ inputs.branch_name }}
- name: Setup R
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: Commit and push changes
run: |
git remote set-url origin https://$GITHUB_ACTOR:${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY.git
git stash
git pull --rebase origin ${{ inputs.branch_name }}
git stash list | grep stash@{0} && git stash pop || echo "No stash to pop"
git add man/\* NAMESPACE DESCRIPTION
git commit -m "docs: update documentation" || echo "No changes to commit"
git push origin ${{ inputs.branch_name }}