diff --git a/README.md b/README.md index 7fc2719..b3f996a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,11 @@ With `reporter: github-pr-review` a comment is added to the Pull Request Convers +### `fail_level` + +Optional. Exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level [`none`, `any`, `info`, `warning`, `error`]. +Default is `none`. + ### `fail_on_error` Optional. Exit code for reviewdog when errors are found [`true`, `false`]. diff --git a/action.yml b/action.yml index b7f08da..ec2aa0c 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,11 @@ description: '🐶 Run rubocop with reviewdog on pull requests to improve code r author: 'mgrachev (reviewdog)' inputs: # Please maintain inputs in alphabetical order + fail_level: + description: | + Exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level [none,any,info,warning,error]. + Default is `none`. + default: 'none' fail_on_error: description: | Exit code for reviewdog when errors are found [true,false] @@ -63,6 +68,7 @@ runs: # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 # Please maintain inputs in alphabetical order + INPUT_FAIL_LEVEL: ${{ inputs.fail_level }} INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} diff --git a/script.sh b/script.sh index 9693ca0..2a69a4c 100755 --- a/script.sh +++ b/script.sh @@ -132,6 +132,7 @@ ${BUNDLE_EXEC}rubocop \ -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER}" \ -filter-mode="${INPUT_FILTER_MODE}" \ + -fail-level="${INPUT_FAIL_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \ -level="${INPUT_LEVEL}" \ ${INPUT_REVIEWDOG_FLAGS}