post failure notification
This commit is contained in:
parent
f95ea519a4
commit
b9ffa534ca
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue