-
Notifications
You must be signed in to change notification settings - Fork 19
90 lines (74 loc) · 3.12 KB
/
Copy pathpr-commands.yaml
File metadata and controls
90 lines (74 loc) · 3.12 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
types: [created]
name: Commands
permissions:
contents: read
pull-requests: read
jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: r-lib/actions/pr-fetch@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
with:
extra-packages: any::roxygen2
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: Create documentation patch
run: |
git diff --binary -- man NAMESPACE > document.patch
if [ ! -s document.patch ]; then
echo "No documentation changes generated." > document.patch
fi
shell: bash
- name: Upload documentation patch
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: document-patch-${{ github.event.issue.number }}
path: document.patch
if-no-files-found: error
style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: r-lib/actions/pr-fetch@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@d3c5be51b12e724e68f33216ca3c148b66d5f0b6 # v2.12.1
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
with:
extra-packages: any::styler
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: Create style patch
run: |
git diff --binary -- '*.R' > style.patch
if [ ! -s style.patch ]; then
echo "No style changes generated." > style.patch
fi
shell: bash
- name: Upload style patch
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: style-patch-${{ github.event.issue.number }}
path: style.patch
if-no-files-found: error