File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Knit Rmd Files
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ workflow_dispatch :
9
+
10
+ jobs :
11
+ knit :
12
+ runs-on : ubuntu-latest
13
+ permissions :
14
+ contents : write
15
+ pull-requests : write
16
+
17
+ steps :
18
+ - name : Checkout repository
19
+ uses : actions/checkout@v4
20
+
21
+ - name : Set up R
22
+ uses : r-lib/actions/setup-r@v2
23
+
24
+ - name : Install dependencies
25
+ run : |
26
+ Rscript -e 'install.packages(c("rmarkdown", "knitr"))'
27
+
28
+ - name : Find and knit Rmd files
29
+ run : |
30
+ Rscript -e '
31
+ rmd_files <- list.files(pattern = "\\.Rmd$", recursive = TRUE)
32
+ for (file in rmd_files) {
33
+ rmarkdown::render(file)
34
+ }
35
+ '
36
+
37
+ - name : Commit changes
38
+ run : |
39
+ git config --global user.name "github-actions[bot]"
40
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
41
+ git add -A
42
+ git commit -m "Knit Rmd files" || echo "No changes to commit"
43
+
44
+ - name : Push changes
45
+
46
+ with :
47
+ branch : ${{ github.head_ref }}
You can’t perform that action at this time.
0 commit comments