From e7733f494f344432331167b1fd1049b4475784c3 Mon Sep 17 00:00:00 2001 From: Trond Einar Snekvik Date: Wed, 30 Nov 2022 13:43:42 +0100 Subject: [PATCH] Only report failure if fail-on-error is set The flag is checked when exiting early, but the report update at the end ignores it, causing the test run to be reported as a failure. Fixes #161. Signed-off-by: Trond Einar Snekvik --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 156d910..935c769 100644 --- a/src/main.ts +++ b/src/main.ts @@ -174,7 +174,7 @@ class TestReporter { core.info('Creating annotations') const annotations = getAnnotations(results, this.maxAnnotations) - const isFailed = results.some(tr => tr.result === 'failed') + const isFailed = this.failOnError && results.some(tr => tr.result === 'failed') const conclusion = isFailed ? 'failure' : 'success' const icon = isFailed ? Icon.fail : Icon.success