From 3a033736aa7045757b939560ce0df8dd647cbf8d Mon Sep 17 00:00:00 2001 From: Wojciech Sipak Date: Wed, 22 Sep 2021 16:42:21 +0200 Subject: [PATCH] add action input fail_on_error --- action.yml | 4 ++++ entrypoint.sh | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 33212d7..c1f99aa 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,10 @@ inputs: description: 'Post results of using --autofix option as change suggestions, works only with github-pre-review reporter' default: 'true' + fail_on_error: + description: 'Fail the action when rule violations are found' + default: 'false' + runs: using: 'docker' diff --git a/entrypoint.sh b/entrypoint.sh index d072a87..40d3a83 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,7 +36,7 @@ if [ "$INPUT_SUGGEST_FIXES" = "true" ]; then --exclude-paths "$INPUT_EXCLUDE_PATHS" \ --log-file "$INPUT_LOG_FILE" \ --patch "$patch" \ - "$INPUT_PATHS" || exitcode=$? + "$INPUT_PATHS" /opt/antmicro/rdf_gen.py \ --efm-file "$INPUT_LOG_FILE" \ @@ -49,7 +49,7 @@ else --extra-opts "$INPUT_EXTRA_ARGS" \ --exclude-paths "$INPUT_EXCLUDE_PATHS" \ --log-file "$INPUT_LOG_FILE" \ - "$INPUT_PATHS" || exitcode=$? + "$INPUT_PATHS" /opt/antmicro/rdf_gen.py \ --efm-file "$INPUT_LOG_FILE" > "$rdf_log" @@ -59,9 +59,9 @@ echo "Running reviewdog" "$GOBIN"/reviewdog -f=rdjson \ -reporter="$INPUT_REVIEWDOG_REPORTER" \ - -fail-on-error="false" \ + -fail-on-error="$INPUT_FAIL_ON_ERROR" \ -name="verible-verilog-lint" \ - -diff="$diff_cmd" < "$rdf_log" || cat "$INPUT_LOG_FILE" + -diff="$diff_cmd" < "$rdf_log" || exitcode=$? if [ -f "$event_file" ]; then git checkout -