From 3160b5305c416ef1a67a64880a1b51d65f8e85e9 Mon Sep 17 00:00:00 2001 From: Ghais Zaher Date: Thu, 25 Mar 2021 09:48:54 +0100 Subject: [PATCH] support filter mode --- README.md | 4 ++++ action.yml | 7 +++++++ entrypoint.sh | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 421d2a9..1408cc1 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ The default is `github-pr-check`. Optional. Fails the current check if any error was found [`true`/`false`] The default value is false. +### `filter_mode` +Optional. Filter mode of reviewdog command [`added`,`diff_context`,`file`,`nofilter`] +Default is `added`. + ### `relative` Optional. Print files relative to the working directory [`true`/`false`] diff --git a/action.yml b/action.yml index 604e509..2d8b9d7 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,12 @@ inputs: Default is false. required: false default: 'false' + filter_mode: + description: | + Filter mode of reviewdog command [added,diff_context,file,nofilter] + Default is added. + required: false + default: 'added' relative: description: Print files relative to the working directory required: false @@ -38,6 +44,7 @@ runs: - ${{ inputs.level }} - ${{ inputs.reporter }} - ${{ inputs.fail_on_error }} + - ${{ inputs.filter_mode }} - ${{ inputs.relative }} - ${{ inputs.android }} branding: diff --git a/entrypoint.sh b/entrypoint.sh index fce397e..76fd961 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,4 +21,4 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" echo KtLint version: "$(ktlint --version)" ktlint --reporter=checkstyle $RELATIVE $ANDROID \ - | reviewdog -f=checkstyle -name="ktlint" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" + | reviewdog -f=checkstyle -name="ktlint" -reporter="${INPUT_REPORTER}" -filter-mode="${INPUT_FILTER_MODE}" -level="${INPUT_LEVEL}"