Skip to content

Commit

Permalink
Add new reviewdog flags introduced by v0.10.0 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 authored Aug 4, 2020
1 parent ca19324 commit 2a56075
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 16 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ It's same as `-reporter` flag of reviewdog.

github-pr-review can use Markdown and add a link to rule page in reviewdog reports.

### `filter_mode`

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

### `fail_on_error`

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

### `reviewdog_flags`

Optional. Additional reviewdog flags.

### `yamllint_flags`

Optional. Flags and args of yamllint command. Default: '.'
Expand Down
41 changes: 27 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
name: 'Run yamllint with reviewdog'
description: '🐶 Run yamllint with reviewdog on pull requests to improve code review experience.'
author: 'aslafy-z'
name: "Run yamllint with reviewdog"
description: "🐶 Run yamllint with reviewdog on pull requests to improve code review experience."
author: "aslafy-z"
inputs:
github_token:
description: 'GITHUB_TOKEN.'
default: '${{ github.token }}'
description: "GITHUB_TOKEN."
default: "${{ github.token }}"
level:
description: 'Report level for reviewdog [info,warning,error]'
default: 'error'
description: "Report level for reviewdog [info,warning,error]"
default: "error"
reporter:
description: |
Reporter of reviewdog command [github-pr-check,github-pr-review].
Reporter of reviewdog command [github-pr-check,github-pr-review,github-check].
Default is github-pr-check.
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
default: '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: ""
yamllint_flags:
description: "flags and args of yamllint command. Default: '.'"
default: '.'
default: "."
runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
branding:
icon: 'alert-octagon'
color: 'blue'
icon: "alert-octagon"
color: "blue"
11 changes: 9 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/sh

cd "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE" || exit

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

yamllint --version

yamllint --format "parsable" ${INPUT_YAMLLINT_FLAGS:-'.'} \
| reviewdog -efm="%f:%l:%c: %m" -name "yamllint" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}"
| reviewdog \
-efm="%f:%l:%c: %m" \
-name "yamllint" \
-reporter="${INPUT_REPORTER:-github-pr-check}" \
-level="${INPUT_LEVEL}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
${INPUT_REVIEWDOG_FLAGS}

0 comments on commit 2a56075

Please sign in to comment.