Skip to content

Commit 6820edf

Browse files
fix: include region in Slack message header
1 parent 60bc1d0 commit 6820edf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sanity-report.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,16 @@ console.log(`Failed Tests: ${failedTests}`);
4444
console.log(`Skipped Tests: ${skippedTests}`);
4545
console.log(`Total Duration: ${totalDurationMinutes}m ${totalDurationSeconds.toFixed(0)}s`);
4646

47+
const host = process.env.HOST || ''
48+
let region = 'UNKNOWN REGION'
49+
50+
const match = host.match(/^([^-]+(?:-[^-]+)*)-api/)
51+
if (match && match[1]) {
52+
region = match[1].toUpperCase()
53+
}
54+
4755
const slackMessage = `
48-
*Typescript CDA Report*
56+
*Typescript CDA Report - ${region}*
4957
• Total Suites: *${totalSuites}*
5058
• Total Tests: *${totalTests}*
5159
• Passed Tests: *${passedTests}*

0 commit comments

Comments
 (0)