1
0
Fork 0
mirror of synced 2024-06-02 02:25:17 +12:00

post failure notification

This commit is contained in:
Martin McKeaveney 2022-08-22 13:15:03 +01:00
parent bfae9f8d51
commit 8219a37ebe

View file

@ -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()