From 231fbdccc730336594f9daaed21c3d8c2f4035ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 May 2020 19:23:32 +0300 Subject: [PATCH] chore(deps): update reviewdog to 0.10.0 (#3) * 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 --- Dockerfile | 2 +- README.md | 18 ++++++++++++++++++ action.yml | 16 ++++++++++------ entrypoint.sh | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9bd68e1..9d2304b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ diff --git a/README.md b/README.md index 3040902..3974e95 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ``` diff --git a/action.yml b/action.yml index 1242db5..a8d2b25 100644 --- a/action.yml +++ b/action.yml @@ -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. @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index 2124a24..20d4ba8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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=$?