From 299520cd1cde122272468eadaff1911195362ffd Mon Sep 17 00:00:00 2001 From: SnowCait Date: Tue, 6 Aug 2024 01:58:14 +0900 Subject: [PATCH 1/2] fix: filter-mode behavior --- script.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/script.sh b/script.sh index 34f1be6..40572bc 100755 --- a/script.sh +++ b/script.sh @@ -88,10 +88,7 @@ if [[ "${INPUT_REPORTER}" == "github-pr-review" ]]; then fi # Throw error if an error occurred and fail_on_error is true -if [[ "${INPUT_FAIL_ON_ERROR}" == "true" \ - && ( "${textlint_exit_val}" != "0" \ - || "${reviewdog_exit_val}" != "0" ) \ - ]]; then +if [[ "${INPUT_FAIL_ON_ERROR}" == "true" && "${reviewdog_exit_val}" != "0" ]]; then exit 1 fi From ac01efbc0d2515bd399c2b60c63f956bd456a4c6 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 7 Aug 2024 21:51:10 +0900 Subject: [PATCH 2/2] fix: treat textlint exitcode --- script.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script.sh b/script.sh index 40572bc..8463eef 100755 --- a/script.sh +++ b/script.sh @@ -88,7 +88,12 @@ if [[ "${INPUT_REPORTER}" == "github-pr-review" ]]; then fi # Throw error if an error occurred and fail_on_error is true -if [[ "${INPUT_FAIL_ON_ERROR}" == "true" && "${reviewdog_exit_val}" != "0" ]]; then +# textlint exitcode: 0 success 1 lint error detect 2 fatal error +if [[ "${INPUT_FAIL_ON_ERROR}" == "true" \ + && (( "${textlint_exit_val}" != "0" \ + || "${textlint_exit_val}" != "1" ) \ + || "${reviewdog_exit_val}" != "0" ) \ + ]]; then exit 1 fi