mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
fix: skip the webhook for non-scheduled, successful runs
This commit is contained in:
parent
41e145556f
commit
f991aceda2
2 changed files with 8 additions and 2 deletions
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
|
@ -174,6 +174,7 @@ class TestReporter {
|
||||||
this.onlySummary = core.getInput('only-summary', { required: false }) === 'true';
|
this.onlySummary = core.getInput('only-summary', { required: false }) === 'true';
|
||||||
this.token = core.getInput('token', { required: true });
|
this.token = core.getInput('token', { required: true });
|
||||||
this.slackWebhook = core.getInput('slack-url', { required: false });
|
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.resultsEndpoint = core.getInput('test-results-endpoint', { required: false });
|
||||||
this.resultsEndpointSecret = core.getInput('test-results-endpoint-secret', { required: false });
|
this.resultsEndpointSecret = core.getInput('test-results-endpoint-secret', { required: false });
|
||||||
this.context = (0, github_utils_1.getCheckRunContext)();
|
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) {
|
catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ class TestReporter {
|
||||||
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
||||||
readonly token = core.getInput('token', {required: true})
|
readonly token = core.getInput('token', {required: true})
|
||||||
readonly slackWebhook = core.getInput('slack-url', {required: false})
|
readonly slackWebhook = core.getInput('slack-url', {required: false})
|
||||||
|
readonly githubEvent = core.getInput('github-event', {required: false})
|
||||||
readonly resultsEndpoint = core.getInput('test-results-endpoint', {required: false})
|
readonly resultsEndpoint = core.getInput('test-results-endpoint', {required: false})
|
||||||
readonly resultsEndpointSecret = core.getInput('test-results-endpoint-secret', {required: false})
|
readonly resultsEndpointSecret = core.getInput('test-results-endpoint-secret', {required: false})
|
||||||
readonly octokit: InstanceType<typeof GitHub>
|
readonly octokit: InstanceType<typeof GitHub>
|
||||||
|
|
@ -357,7 +358,9 @@ class TestReporter {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await webhook.send(req)
|
if (this.githubEvent === 'schedule' || failed > 0) {
|
||||||
|
await webhook.send(req)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(`Could not create check to store the results`)
|
core.error(`Could not create check to store the results`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue