slack username

This commit is contained in:
A.J. Kaptijn 2024-03-18 21:18:22 +01:00
parent 7cb3970161
commit 52df78dda0
2 changed files with 9 additions and 5 deletions

10
dist/index.js generated vendored
View file

@ -356,7 +356,9 @@ class TestReporter {
core.info(`Check run details: ${resp.data.details_url}`);
result.checkUrl = resp.data.html_url;
if (this.slackWebhook && this.context.branch === 'master') {
const webhook = new webhook_1.IncomingWebhook(this.slackWebhook);
const webhook = new webhook_1.IncomingWebhook(this.slackWebhook, {
username: name
});
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
@ -383,9 +385,9 @@ class TestReporter {
}
});
if (failed <= 10) {
tr.failedSuites.map((suite) => {
suite.failedGroups.map((group) => {
group.failedTests.map((test) => {
tr.failedSuites.map(suite => {
suite.failedGroups.map(group => {
group.failedTests.map(test => {
req.blocks.push({
type: 'section',
text: {

View file

@ -300,7 +300,9 @@ class TestReporter {
result.checkUrl = resp.data.html_url
if (this.slackWebhook && this.context.branch === 'master') {
const webhook = new IncomingWebhook(this.slackWebhook)
const webhook = new IncomingWebhook(this.slackWebhook, {
username: name
})
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)