Skip to content

Commit

Permalink
chore(deps): update reviewdog to 0.10.0 (#3)
Browse files Browse the repository at this point in the history
* chore(deps): update reviewdog to 0.10.0

* Add new flags from v0.10.0

* Add example for new flags

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Ionescu <[email protected]>
  • Loading branch information
github-actions[bot] and Vlaaaaaaad authored May 9, 2020
1 parent c22a09e commit 231fbdc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.11

ENV REVIEWDOG_VERSION=v0.9.17
ENV REVIEWDOG_VERSION=v0.10.0

# hadolint ignore=DL3018
RUN apk --no-cache --update add bash git \
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ The default is `error`.
Optional. Reporter of reviewdog command [`github-pr-check`,`github-pr-review`].
The default is `github-pr-check`.

### `filter_mode`

Optional. Filtering for the reviewdog command [`added`,`diff_context`,`file`,`nofilter`].

The default is `added`.

See [reviewdog doccumentation for filter mode](https://github.com/reviewdog/reviewdog/tree/master#filter-mode) for details.

### `fail_on_error`

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

The default is `false`.

See [reviewdog doccumentation for exit codes](https://github.com/reviewdog/reviewdog/tree/master#exit-codes) for details.

### `working_directory`

Optional. Directory to run the action on, from the repo root.
Expand Down Expand Up @@ -85,6 +101,8 @@ jobs:
github_token: ${{ secrets.github_token }}
working_directory: "testdata" # Change working directory
reporter: github-pr-review # Change reporter
fail_on_error: "true" # Fail action if errors are found
filter_mode: "nofilter" # Check all files, not just the diff
flags: "" # Optional
```
Expand Down
16 changes: 10 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ inputs:
Reporter of reviewdog command [github-pr-check,github-pr-review].
Default is github-pr-check.
default: 'github-pr-check'
filter_mode:
description: |
Filtering 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'
working_directory:
description: |
Directory to run the action on, from the repo root.
Expand All @@ -35,12 +45,6 @@ outputs:
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.github_token }}
- ${{ inputs.level }}
- ${{ inputs.reporter }}
- ${{ inputs.working_directory }}
- ${{ inputs.flags }}
branding:
icon: 'edit'
color: 'gray-dark'
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

tfsec --format=checkstyle ${INPUT_FLAGS} "${INPUT_WORKING_DIRECTORY}" \
| reviewdog -f=checkstyle -name="tfsec" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"
| reviewdog -f=checkstyle -name="tfsec" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" -fail-on-error="${INPUT_FAIL_ON_ERROR}" -filter-mode="${INPUT_FILTER_MODE}"

tfsec_return="${PIPESTATUS[0]}" reviewdog_return="${PIPESTATUS[1]}" exit_code=$?

Expand Down

0 comments on commit 231fbdc

Please sign in to comment.