From 6bb029946bbd3c67f8c0d283b1aab4ebeb352274 Mon Sep 17 00:00:00 2001 From: "Valentin D. Pinkman" Date: Thu, 3 Oct 2024 11:54:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20(danger):=20Fix=20danger=20scrip?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danger/dangerfile-ci.ts | 13 ++++++++----- danger/dangerfile-local-fork.ts | 10 ++++++---- danger/dangerfile-local.ts | 10 ++++++---- 3 files changed, 20 insertions(+), 13 deletions(-) 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: "✅" });