From 0ba39e3e6d01e0aeef28a5a9d2ba6191015d10f1 Mon Sep 17 00:00:00 2001 From: Joshua Shapiro Date: Mon, 11 Mar 2024 15:14:30 -0400 Subject: [PATCH 1/2] Add check for blank second argument --- spell-check.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spell-check.R b/spell-check.R index 78856ce..cdd4f6c 100644 --- a/spell-check.R +++ b/spell-check.R @@ -5,6 +5,7 @@ # To modify this behavior, provide a command-line argument with the extensions to check. arguments <- commandArgs(trailingOnly = TRUE) + file_pattern <- "(?i)\\.(md|rmd)$" # dictionary is required first argument @@ -12,7 +13,7 @@ dict_file <- arguments[1] arguments <- arguments[-1] # if there are arguments, check those files, otherwise check all markdown & rmd files -if (length(arguments) > 0) { +if (length(arguments) > 0 && arguments[1] != "") { files <- arguments[grepl(file_pattern, arguments)] } else { files <- list.files(pattern = file_pattern, recursive = TRUE, full.names = TRUE) From 5b14cd4be284cc92530851079d1a9c73016b7c46 Mon Sep 17 00:00:00 2001 From: Joshua Shapiro Date: Mon, 11 Mar 2024 15:16:07 -0400 Subject: [PATCH 2/2] bump version --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index a4c767b..4933deb 100644 --- a/action.yaml +++ b/action.yaml @@ -14,7 +14,7 @@ outputs: description: The number of spelling errors runs: using: "docker" - image: docker://ghcr.io/alexslemonade/spellcheck:v0.1.0 + image: docker://ghcr.io/alexslemonade/spellcheck:v0.1.1 args: - ${{ inputs.dictionary || '/dev/null' }} - ${{ inputs.files }}