Update qa test notify script to be env aware

This commit is contained in:
Rory Powell 2023-06-09 20:39:14 +01:00
parent 2e76885cd1
commit b1287d6a9f
1 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,12 @@ async function generateReport() {
return JSON.parse(report) return JSON.parse(report)
} }
const env = process.argv.slice(2)[0]
if (!env) {
throw new Error("environment argument is required")
}
async function discordResultsNotification(report) { async function discordResultsNotification(report) {
const { const {
numTotalTestSuites, numTotalTestSuites,
@ -39,8 +45,8 @@ async function discordResultsNotification(report) {
content: `**Nightly Tests Status**: ${OUTCOME}`, content: `**Nightly Tests Status**: ${OUTCOME}`,
embeds: [ embeds: [
{ {
title: "Budi QA Bot", title: `Budi QA Bot - ${env}`,
description: `Nightly Tests`, description: `API Integration Tests`,
url: GITHUB_ACTIONS_RUN_URL, url: GITHUB_ACTIONS_RUN_URL,
color: OUTCOME === "success" ? 3066993 : 15548997, color: OUTCOME === "success" ? 3066993 : 15548997,
timestamp: new Date(), timestamp: new Date(),