Skip to content

Commit

Permalink
Merge pull request #11 from reviewdog/add_fail_level
Browse files Browse the repository at this point in the history
Add fail_level and deduplicate fail_on_error
  • Loading branch information
massongit authored Dec 3, 2024
2 parents ff3f184 + c3667d1 commit 28cbb3b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ inputs:
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_level:
description: |
If set to `none`, always use exit code 0 for reviewdog.
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
Possible values: [none,any,info,warning,error]
Default is `none`.
default: 'none'
fail_on_error:
description: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
deprecationMessage: Deprecated, use `fail_level` instead.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags'
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ inputs:
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added.
default: 'added'
fail_level:
description: |
If set to `none`, always use exit code 0 for reviewdog.
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
Possible values: [none,any,info,warning,error]
Default is `none`.
default: 'none'
fail_on_error:
description: |
Deprecated, use `fail_level` instead.
Exit code for reviewdog when errors are found [true,false]
Default is `false`.
deprecationMessage: Deprecated, use `fail_level` instead.
default: 'false'
reviewdog_flags:
description: 'Additional reviewdog flags'
Expand Down
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ -n "${GITHUB_WORKSPACE}" ] ; then
git config --global --add safe.directory "${GITHUB_WORKSPACE}" || exit 1
fi

wget -O /usr/local/bin/regal -q "https://github.com/StyraInc/regal/releases/download/"${INPUT_REGAL_VERSION}"/regal_Linux_x86_64" \
wget -O /usr/local/bin/regal -q "https://github.com/StyraInc/regal/releases/download/${INPUT_REGAL_VERSION}/regal_Linux_x86_64" \
&& chmod +x /usr/local/bin/regal

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
Expand All @@ -33,6 +33,7 @@ regal lint "${INPUT_POLICY_PATH}" ${INPUT_REGAL_FLAGS} -f json \
-name="regal" \
-reporter="${INPUT_REPORTER:-github-pr-check}" \
-filter-mode="${INPUT_FILTER_MODE}" \
-fail-level="${INPUT_FAIL_LEVEL}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}

0 comments on commit 28cbb3b

Please sign in to comment.