Skip to content

Commit

Permalink
Disable auto-commits for styler workflow (#227)
Browse files Browse the repository at this point in the history
Disable auto commits until the unicode styling issues have been fixed.

---------

Signed-off-by: cicdguy <[email protected]>
  • Loading branch information
cicdguy authored May 6, 2024
1 parent 8c74959 commit 365dd32
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ jobs:
ext %in% c("R", "Rmd", "Rnw", "Rmarkdown", "qmd")
}
changed_r_files <- Filter(is_r_file, changed_files)
dry <- if(isTRUE(as.logical("${{ inputs.auto-update }}"))) "off" else "on"
# TODO: Re-enable after styler unicode issues are fixed
#dry <- if(isTRUE(as.logical("${{ inputs.auto-update }}"))) "off" else "on"
dry <- "on"
detect <- styler::style_file(changed_r_files, dry = dry)
if (TRUE %in% detect$changed) {
problems <- subset(detect$file, detect$changed == T)
Expand Down Expand Up @@ -155,9 +157,11 @@ jobs:

- name: Autocommit styled files ↗️
id: autocommit-styled-files
if: >
inputs.auto-update
&& steps.check_files.outputs.files_exists == 'true'
if: false
# TODO: Re-enable after styler unicode issues are fixed
#if: >
# inputs.auto-update
# && steps.check_files.outputs.files_exists == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
Expand All @@ -184,12 +188,14 @@ jobs:
"or simply run the following commands",
"for an immediate fix:\n"
))
cat("────────────────────────────────────────\n")
cat(paste0(
"styler::style_file(",
readLines("/tmp/style-problems.R", warn=FALSE),
")\n"
))
cat("────────────────────────────────────────\n")
if (file.exists("/tmp/style-problems.R")) {
cat("────────────────────────────────────────\n")
cat(paste0(
"styler::style_file(",
readLines("/tmp/style-problems.R", warn=FALSE),
")\n"
))
cat("────────────────────────────────────────\n")
}
quit(status = 1)
shell: Rscript {0}

0 comments on commit 365dd32

Please sign in to comment.