Skip to content

Commit

Permalink
Update transform-R-to-Rmd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vsyrgkanis authored Jul 13, 2024
1 parent 3f2dce9 commit 6f76400
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/transform-R-to-Rmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,13 @@ jobs:
linters <- with_defaults(line_length_linter = line_length_linter(120))
rmd_files <- list.files(path = "PM1", pattern = "\\.Rmd$", full.names = TRUE)
results <- lapply(rmd_files, function(file) {
lint(file, linters)
lints <- lint(file, linters)
if (length(lints) > 0) {
cat("Warnings found during linting:\n")
print(lints)
stop("Linting failed with warnings")
}
})
warnings <- unlist(lapply(results, function(res) {
res[grep("^Warning:", res$message)]
}))
if (length(warnings) > 0) {
cat("Warnings found during linting:\n")
cat(warnings, sep="\n")
stop("Linting failed with warnings")
}
'
- name: Zip .R files
Expand All @@ -80,6 +77,11 @@ jobs:
name: r-scripts
path: r_scripts.zip

- name: Delete .R files and zip
run: |
rm -rf r_scripts
rm r_scripts.zip
- name: Commit and push stripped .irnb and .Rmd files
run: |
git config --global user.name 'github-actions[bot]'
Expand Down

0 comments on commit 6f76400

Please sign in to comment.