Skip to content

Commit

Permalink
add fail_on_error input
Browse files Browse the repository at this point in the history
  • Loading branch information
Doarakko committed Jun 13, 2021
1 parent c61f0ac commit fc2271f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ e.g. `.git/*`

Optional. Filtering mode for the reviewdog command `[added,diff_context,file,nofilter]`. Default: `added`.

### `fail_on_error`

Optional. Exit code for reviewdog when errors are found [true,false]. Default: `false`.

## 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 @@ -29,6 +29,9 @@ inputs:
filter_mode:
description: "Filtering mode for the reviewdog command [added,diff_context,file,nofilter]."
default: 'added'
fail_on_error:
description: "Exit code for reviewdog when errors are found [true,false]."
default: 'false'
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ 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" -filter-mode="${INPUT_FILTER_MODE:-added}" -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}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}"
exit_code=$?

exit $exit_code

0 comments on commit fc2271f

Please sign in to comment.