fix: skip the webhook for non-scheduled, successful runs

This commit is contained in:
A.J. Kaptijn 2025-03-19 15:39:41 +01:00
parent 41e145556f
commit f991aceda2
2 changed files with 8 additions and 2 deletions

5
dist/index.js generated vendored
View file

@ -174,6 +174,7 @@ class TestReporter {
this.onlySummary = core.getInput('only-summary', { required: false }) === 'true';
this.token = core.getInput('token', { required: true });
this.slackWebhook = core.getInput('slack-url', { required: false });
this.githubEvent = core.getInput('github-event', { required: false });
this.resultsEndpoint = core.getInput('test-results-endpoint', { required: false });
this.resultsEndpointSecret = core.getInput('test-results-endpoint-secret', { required: false });
this.context = (0, github_utils_1.getCheckRunContext)();
@ -408,7 +409,9 @@ class TestReporter {
});
}
});
yield webhook.send(req);
if (this.githubEvent === 'schedule' || failed > 0) {
yield webhook.send(req);
}
}
}
catch (error) {