diff --git a/action/entrypoint.sh b/action/entrypoint.sh index 6a68541..6d4eed5 100644 --- a/action/entrypoint.sh +++ b/action/entrypoint.sh @@ -29,4 +29,6 @@ fi; # Exit with code from the build step. # +if [ $USE_EXIT_CODE = true ]; then exit $TEST_RUNNER_EXIT_CODE +fi; diff --git a/src/index.js b/src/index.js index cfd91da..2e338ff 100644 --- a/src/index.js +++ b/src/index.js @@ -30,16 +30,20 @@ async function action() { testMode, artifactsPath, useHostNetwork, + createCheck, customParameters, }); - - if (createCheck) { - await ResultsCheck.publishResults(artifactsPath, githubToken); - } } finally { // Set output await Output.setArtifactsPath(artifactsPath); } + + if (createCheck) { + const fail = await ResultsCheck.publishResults(artifactsPath, githubToken); + if (fail > 0) { + core.setFailed('Tests Failed! See Test Results for details.'); + } + } } action().catch(error => {