diff --git a/danger/dangerfile-ci.ts b/danger/dangerfile-ci.ts index 52d3cc84a..ddd61df7f 100644 --- a/danger/dangerfile-ci.ts +++ b/danger/dangerfile-ci.ts @@ -14,16 +14,19 @@ console.log("PR Actor:", author); checkIfBot(danger.github.pr.user); -let successful = true; +const results: boolean[] = []; + let fork = isFork(danger.github.pr); -successful = checkBranches(danger, fail, fork); +results.push(checkBranches(danger, fail, fork)); + +results.push(checkCommits(danger, fail, fork)); -successful = checkCommits(danger, fail, fork); +results.push(checkTitle(danger, fail, fork)); -successful = checkTitle(danger, fail, fork); +results.push(checkChangesets(danger, message)); -successful = checkChangesets(danger, message); +const successful = results.every((result) => result === true); if (successful) { message("Danger: All checks passed successfully! 🎉", { icon: "✅" }); diff --git a/danger/dangerfile-local-fork.ts b/danger/dangerfile-local-fork.ts index 53cdbd47b..1b846a154 100644 --- a/danger/dangerfile-local-fork.ts +++ b/danger/dangerfile-local-fork.ts @@ -9,13 +9,15 @@ import { const author = getAuthor(danger); console.log("PR Actor:", author); -let successful = true; +const results: boolean[] = []; -successful = checkBranches(danger, fail, true); +results.push(checkBranches(danger, fail, true)); -successful = checkCommits(danger, fail, true); +results.push(checkCommits(danger, fail, true)); -successful = checkChangesets(danger, message); +results.push(checkChangesets(danger, message)); + +const successful = results.every((result) => result === true); if (successful) { message("Danger: All checks passed successfully! 🎉", { icon: "✅" }); diff --git a/danger/dangerfile-local.ts b/danger/dangerfile-local.ts index 43b1292c2..7d1e7bd2b 100644 --- a/danger/dangerfile-local.ts +++ b/danger/dangerfile-local.ts @@ -9,13 +9,15 @@ import { const author = getAuthor(danger); console.log("PR Actor:", author); -let successful = true; +const results: boolean[] = []; -successful = checkBranches(danger, fail); +results.push(checkBranches(danger, fail)); -successful = checkCommits(danger, fail); +results.push(checkCommits(danger, fail)); -successful = checkChangesets(danger, message); +results.push(checkChangesets(danger, message)); + +const successful = results.every((result) => result === true); if (successful) { message("Danger: All checks passed successfully! 🎉", { icon: "✅" });