Skip to content

Commit

Permalink
Add reporter input
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Grachev <[email protected]>
  • Loading branch information
mgrachev committed Nov 18, 2019
1 parent 20f9312 commit d0bcdb5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -22,6 +27,7 @@ runs:
- ${{ inputs.rubocop_flags }}
- ${{ inputs.tool_name }}
- ${{ inputs.level }}
- ${{ inputs.reporter }}
branding:
icon: 'check-circle'
color: 'red'
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit d0bcdb5

Please sign in to comment.