diff --git a/README.md b/README.md index 1ae8817..14cc9ff 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,33 @@ With `reporter: github-pr-review` a comment is added to the Pull Request Convers ## Inputs +### `fail_on_error` + +Optional. Exit code for reviewdog when errors are found [`true`, `false`]. +Default is `false`. + +### `filter_mode` + +Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`]. +Default is `added`. + ### `github_token` `GITHUB_TOKEN`. Default is `${{ github.token }}`. -### `rubocop_version` +### `level` -Optional. Set rubocop version. Possible values: +Optional. Report level for reviewdog [`info`, `warning`, `error`]. +It's same as `-level` flag of reviewdog. -- empty or omit: install latest version -- `gemfile`: install version from Gemfile (`Gemfile.lock` should be presented, otherwise it will fallback to latest bundler version) -- version (e.g. `0.90.0`): install said version +### `reporter` + +Optional. Reporter of reviewdog command [`github-pr-check`, `github-check`, `github-pr-review`]. +The default is `github-pr-check`. + +### `reviewdog_flags` + +Optional. Additional reviewdog flags. ### `rubocop_extensions` @@ -57,47 +73,31 @@ You can combine `gemfile`, fixed and latest bundle version as you want to. Optional. Rubocop flags. (rubocop ``). -### `tool_name` - -Optional. Tool name to use for reviewdog reporter. Useful when running multiple -actions with different config. - -### `level` - -Optional. Report level for reviewdog [`info`, `warning`, `error`]. -It's same as `-level` flag of reviewdog. +### `rubocop_version` -### `reporter` +Optional. Set rubocop version. Possible values: -Optional. Reporter of reviewdog command [`github-pr-check`, `github-check`, `github-pr-review`]. -The default is `github-pr-check`. +- empty or omit: install latest version +- `gemfile`: install version from Gemfile (`Gemfile.lock` should be presented, otherwise it will fallback to latest bundler version) +- version (e.g. `0.90.0`): install said version -### `filter_mode` +### `skip_install` -Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`]. -Default is `added`. +Optional. Do not install Rubocop or its extensions. Default: `false`. -### `fail_on_error` +### `tool_name` -Optional. Exit code for reviewdog when errors are found [`true`, `false`]. -Default is `false`. +Optional. Tool name to use for reviewdog reporter. Useful when running multiple +actions with different config. -### `reviewdog_flags` +### `use_bundler` -Optional. Additional reviewdog flags. +Optional. Run Rubocop with bundle exec. Default: `false`. ### `workdir` Optional. The directory from which to look for and run Rubocop. Default `.`. -### `skip_install` - -Optional. Do not install Rubocop or its extensions. Default: `false`. - -### `use_bundler` - -Optional. Run Rubocop with bundle exec. Default: `false`. - ## Example usage This action will use your [RuboCop Configuration](https://docs.rubocop.org/rubocop/configuration.html) automatically. diff --git a/action.yml b/action.yml index 7cd76cc..ea0e38c 100644 --- a/action.yml +++ b/action.yml @@ -2,20 +2,19 @@ name: 'Run rubocop with reviewdog' description: '🐶 Run rubocop with reviewdog on pull requests to improve code review experience.' author: 'mgrachev (reviewdog)' inputs: + fail_on_error: + description: | + Exit code for reviewdog when errors are found [true,false] + Default is `false`. + default: 'false' + filter_mode: + description: | + Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. + Default is added. + default: 'added' github_token: description: 'GITHUB_TOKEN' default: ${{ github.token }} - rubocop_version: - description: 'Rubocop version' - rubocop_extensions: - description: 'Rubocop extensions' - default: 'rubocop-rails rubocop-performance rubocop-rspec rubocop-i18n rubocop-rake' - rubocop_flags: - description: 'Rubocop flags. (rubocop )' - default: '' - tool_name: - description: 'Tool name to use for reviewdog reporter' - default: 'rubocop' level: description: 'Report level for reviewdog [info,warning,error]' default: 'error' @@ -24,28 +23,29 @@ inputs: Reporter of reviewdog command [github-pr-check,github-check,github-pr-review]. Default is github-pr-check. default: 'github-pr-check' - filter_mode: - description: | - Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. - Default is added. - default: 'added' - fail_on_error: - description: | - Exit code for reviewdog when errors are found [true,false] - Default is `false`. - default: 'false' reviewdog_flags: description: 'Additional reviewdog flags' default: '' - workdir: - description: "The directory from which to look for and run Rubocop. Default '.'" - default: '.' + rubocop_extensions: + description: 'Rubocop extensions' + default: 'rubocop-rails rubocop-performance rubocop-rspec rubocop-i18n rubocop-rake' + rubocop_flags: + description: 'Rubocop flags. (rubocop )' + default: '' + rubocop_version: + description: 'Rubocop version' skip_install: description: "Do not install Rubocop or its extensions. Default: `false`" default: 'false' + tool_name: + description: 'Tool name to use for reviewdog reporter' + default: 'rubocop' use_bundler: description: "Run Rubocop with bundle exec. Default: `false`" default: 'false' + workdir: + description: "The directory from which to look for and run Rubocop. Default '.'" + default: '.' runs: using: 'composite' steps: @@ -55,19 +55,19 @@ runs: REVIEWDOG_VERSION: v0.17.4 # INPUT_ is not available in Composite run steps # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 + INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} + INPUT_FILTER_MODE: ${{ inputs.filter_mode }} INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} - INPUT_RUBOCOP_VERSION: ${{ inputs.rubocop_version }} - INPUT_RUBOCOP_EXTENSIONS: ${{ inputs.rubocop_extensions }} - INPUT_RUBOCOP_FLAGS: ${{ inputs.rubocop_flags }} - INPUT_TOOL_NAME: ${{ inputs.tool_name }} INPUT_LEVEL: ${{ inputs.level }} INPUT_REPORTER: ${{ inputs.reporter }} - INPUT_FILTER_MODE: ${{ inputs.filter_mode }} - INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }} - INPUT_WORKDIR: ${{ inputs.workdir }} + INPUT_RUBOCOP_EXTENSIONS: ${{ inputs.rubocop_extensions }} + INPUT_RUBOCOP_FLAGS: ${{ inputs.rubocop_flags }} + INPUT_RUBOCOP_VERSION: ${{ inputs.rubocop_version }} INPUT_SKIP_INSTALL: ${{ inputs.skip_install }} + INPUT_TOOL_NAME: ${{ inputs.tool_name }} INPUT_USE_BUNDLER: ${{ inputs.use_bundler }} + INPUT_WORKDIR: ${{ inputs.workdir }} branding: icon: 'check-circle' color: 'red'