From 751aec51d738c7acde05d89138f5318ced0f4723 Mon Sep 17 00:00:00 2001 From: Walt Della Date: Tue, 28 Nov 2023 15:13:03 -0800 Subject: [PATCH] Fail the job if any steps have errors Previously this logic only failed the job if the last step had an error. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2bc8c0a..a1d3555 100644 --- a/src/index.js +++ b/src/index.js @@ -37,7 +37,7 @@ async function run() { jobHasError = runAssertions(uses, allowlist, isDryRun); } else if (steps !== undefined) { for (const step of steps) { - jobHasError = runAssertions(step['uses'], allowlist, isDryRun); + jobHasError ||= runAssertions(step['uses'], allowlist, isDryRun); } } else { core.warning(`The "${job}" job of the "${basename}" workflow does not contain uses or steps.`);