mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-04 04:05:22 -08:00
Fail (optionally) the action if test report contains any failed test
This commit is contained in:
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@@ -41,6 +41,7 @@ async function run() {
|
||||
}
|
||||
}
|
||||
async function main() {
|
||||
const failOnError = core.getInput('fail-on-error', { required: true }) === 'true';
|
||||
const name = core.getInput('name', { required: true });
|
||||
const path = core.getInput('path', { required: true });
|
||||
const reporter = core.getInput('reporter', { required: true });
|
||||
@@ -60,6 +61,9 @@ async function main() {
|
||||
...github.context.repo
|
||||
});
|
||||
core.setOutput('conclusion', conclusion);
|
||||
if (failOnError && !result.success) {
|
||||
core.setFailed(`Failed test has been found and 'fail-on-error' option is set to ${failOnError}.`);
|
||||
}
|
||||
}
|
||||
function getParser(reporter) {
|
||||
switch (reporter) {
|
||||
|
||||
Reference in New Issue
Block a user