Skip to content

Commit

Permalink
Merge pull request #24 from limakzi/feature/add-filter
Browse files Browse the repository at this point in the history
Add input filter mode
  • Loading branch information
haya14busa authored Jan 3, 2021
2 parents db924d1 + 45333fb commit 5a148ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit 5a148ec

Please sign in to comment.