fix typo and throw error when languages are not detected

This commit is contained in:
Alex Kalyvitis 2020-06-24 14:31:06 +02:00
parent 3871ca717b
commit a67896b792
6 changed files with 6 additions and 8 deletions

3
lib/setup-tracer.js generated
View file

@ -138,8 +138,7 @@ async function run() {
// If the languages parameter was not given and no languages were // If the languages parameter was not given and no languages were
// detected then fail here as this is a workflow configuration error. // detected then fail here as this is a workflow configuration error.
if (languages.length === 0) { if (languages.length === 0) {
core.setFailed("Did not detect any languages to analyze. Please update input in workflow."); throw new Error("Did not detect any languages to analyze. Please update input in workflow.");
return;
} }
analysisPaths.includeAndExcludeAnalysisPaths(config, languages); analysisPaths.includeAndExcludeAnalysisPaths(config, languages);
core.endGroup(); core.endGroup();

File diff suppressed because one or more lines are too long

2
lib/util.js generated
View file

@ -334,7 +334,7 @@ exports.reportActionSucceeded = reportActionSucceeded;
* this is likely to give a more useful duration when inspecting events. * this is likely to give a more useful duration when inspecting events.
*/ */
async function reportActionAborted(action, cause) { async function reportActionAborted(action, cause) {
await sendStatusReport(await createStatusReport(action, 'abort', cause)); await sendStatusReport(await createStatusReport(action, 'aborted', cause));
} }
exports.reportActionAborted = reportActionAborted; exports.reportActionAborted = reportActionAborted;
/** /**

File diff suppressed because one or more lines are too long

View file

@ -156,8 +156,7 @@ async function run() {
// If the languages parameter was not given and no languages were // If the languages parameter was not given and no languages were
// detected then fail here as this is a workflow configuration error. // detected then fail here as this is a workflow configuration error.
if (languages.length === 0) { if (languages.length === 0) {
core.setFailed("Did not detect any languages to analyze. Please update input in workflow."); throw new Error("Did not detect any languages to analyze. Please update input in workflow.")
return;
} }
analysisPaths.includeAndExcludeAnalysisPaths(config, languages); analysisPaths.includeAndExcludeAnalysisPaths(config, languages);

View file

@ -372,7 +372,7 @@ export async function reportActionSucceeded(action: string) {
* this is likely to give a more useful duration when inspecting events. * this is likely to give a more useful duration when inspecting events.
*/ */
export async function reportActionAborted(action: string, cause?: string) { export async function reportActionAborted(action: string, cause?: string) {
await sendStatusReport(await createStatusReport(action, 'abort', cause)); await sendStatusReport(await createStatusReport(action, 'aborted', cause));
} }
/** /**