From d0bcdb55cba723d22c730180b8775d174a104cb8 Mon Sep 17 00:00:00 2001 From: Mikhail Grachev Date: Mon, 18 Nov 2019 19:11:20 +0300 Subject: [PATCH] Add reporter input Signed-off-by: Mikhail Grachev --- README.md | 14 ++++++++++---- action.yml | 6 ++++++ entrypoint.sh | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 153e031..0c89e8b 100644 --- a/README.md +++ b/README.md @@ -21,25 +21,31 @@ actions with different config. ### `level` -Optional. Report level for reviewdog [info,warning,error]. +Optional. Report level for reviewdog [`info`, `warning`, `error`]. It's same as `-level` flag of reviewdog. +### `reporter` + +Optional. Reporter of reviewdog command [`github-pr-check`, `github-pr-review`]. +The default is `github-pr-check`. + ## Example usage ```yml name: reviewdog on: [pull_request] jobs: - misspell: + rubocop: name: runner / rubocop runs-on: ubuntu-latest steps: - - name: Check out code. + - name: Check out code uses: actions/checkout@v1 - name: rubocop - uses: mgrachev/action-rubocop@v0.1.3 + uses: mgrachev/action-rubocop@v1.0.0 with: github_token: ${{ secrets.github_token }} + reporter: github-pr-review # Default is github-pr-check ``` ## Sponsor diff --git a/action.yml b/action.yml index 0b7de84..ad275a7 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,11 @@ inputs: level: description: 'Report level for reviewdog [info,warning,error]' default: 'error' + reporter: + description: | + Reporter of reviewdog command [github-pr-check,github-pr-review]. + Default is github-pr-check. + default: 'github-pr-check' runs: using: 'docker' image: 'Dockerfile' @@ -22,6 +27,7 @@ runs: - ${{ inputs.rubocop_flags }} - ${{ inputs.tool_name }} - ${{ inputs.level }} + - ${{ inputs.reporter }} branding: icon: 'check-circle' color: 'red' diff --git a/entrypoint.sh b/entrypoint.sh index 2714878..622b5cc 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,4 +5,4 @@ cd "$GITHUB_WORKSPACE" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" rubocop ${INPUT_RUBOCOP_FLAGS} \ - | /bin/reviewdog -f=rubocop -name="${INPUT_TOOL_NAME}" -reporter=github-pr-check -level="${INPUT_LEVEL}" + | /bin/reviewdog -f=rubocop -name="${INPUT_TOOL_NAME}" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"