From 8219a37ebe58a59cb12683e75fbb2de687460665 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 22 Aug 2022 13:15:03 +0100 Subject: [PATCH] post failure notification --- packages/builder/scripts/cypressResultsWebhook.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/builder/scripts/cypressResultsWebhook.js b/packages/builder/scripts/cypressResultsWebhook.js index c22c46207d..4de4c01cc7 100644 --- a/packages/builder/scripts/cypressResultsWebhook.js +++ b/packages/builder/scripts/cypressResultsWebhook.js @@ -5,7 +5,6 @@ const path = require("path") const fs = require("fs") const WEBHOOK_URL = process.env.CYPRESS_WEBHOOK_URL -const OUTCOME = process.env.CYPRESS_OUTCOME const DASHBOARD_URL = process.env.CYPRESS_DASHBOARD_URL const GIT_SHA = process.env.GITHUB_SHA const GITHUB_ACTIONS_RUN_URL = process.env.GITHUB_ACTIONS_RUN_URL @@ -35,6 +34,8 @@ async function discordCypressResultsNotification(report) { skipped, } = report.stats + const OUTCOME = failures > 0 ? "failure" : "success" + const options = { method: "POST", headers: { @@ -123,12 +124,8 @@ async function discordCypressResultsNotification(report) { } async function run() { - try { - const report = await generateReport() - await discordCypressResultsNotification(report) - } catch (err) { - console.error(err) - } + const report = await generateReport() + await discordCypressResultsNotification(report) } run()