Skip to content

Commit

Permalink
Fail the job if any steps have errors
Browse files Browse the repository at this point in the history
Previously this logic only failed the job if the last step had an error.
  • Loading branch information
wadells committed Nov 28, 2023
1 parent bc1410a commit 730c7d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
Expand Down Expand Up @@ -107,4 +107,4 @@ function runAssertions(uses, allowlist, isDryRun) {
}

return hasError;
}
}

0 comments on commit 730c7d4

Please sign in to comment.