Skip to content

Commit 6dcb6ac

Browse files
Merge pull request #351 from contentstack/fix/sanity-region-fetch
Fix/sanity region fetch
2 parents 7a5e905 + 203f4a2 commit 6dcb6ac

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sanity-report.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ console.log(`Failed Tests: ${failedTests}`)
2525
console.log(`Pending Tests: ${pendingTests}`)
2626
console.log(`Total Duration: ${durationInMinutes}m ${durationInSeconds.toFixed(2)}s`)
2727

28+
const host = process.env.HOST || ''
29+
let region = 'NA'
30+
31+
const match = host.match(/^([^-]+(?:-[^-]+)*)-api/)
32+
if (match && match[1]) {
33+
region = match[1].toUpperCase()
34+
}
35+
2836
const slackMessage = `
29-
*JavaScript CMA Report*
37+
*JavaScript CMA Report - ${region}*
3038
• Total Suites: *${totalSuites}*
3139
• Total Tests: *${totalTests}*
3240
• Passed Tests: *${passedTests}*

0 commit comments

Comments
 (0)