diff --git a/README.md b/README.md index 21fce23..619d029 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,10 @@ Optional. File patterns of target files. Same as `-name [pattern]` of `find` com Optional. Exclude patterns of target files. Same as `-not -path [exclude]` of `find` command. e.g. `.git/*` +### `filter_mode` + +Optional. Filtering mode for the reviewdog command `[added,diff_context,file,nofilter]`. Default: `added`. + ## Example usage ### [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml) diff --git a/action.yml b/action.yml index 499584a..0d7d878 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,9 @@ inputs: exclude: description: "Exclude patterns of target files. Same as `-not -path [exclude]` of `find` command." default: '' + filter_mode: + description: "Filtering mode for the reviewdog command [added,diff_context,file,nofilter]." + default: 'added' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 2185416..0114a4e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,4 +6,4 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" find "${INPUT_PATH:-'.'}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN:-'*'}" -print0 \ | xargs -0 misspell -locale="${INPUT_LOCALE}" -i "${INPUT_IGNORE}" \ - | reviewdog -efm="%f:%l:%c: %m" -name="misspell" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}" + | reviewdog -efm="%f:%l:%c: %m" -filter-mode="${INPUT_FILTER_MODE:-added}" -name="misspell" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}"