Skip to content

Commit

Permalink
Showing 3 changed files with 20 additions and 11 deletions.
14 changes: 9 additions & 5 deletions lib/config-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.js.map
15 changes: 10 additions & 5 deletions src/config-utils.ts
@@ -452,6 +452,9 @@ async function getLanguagesInRepo(): Promise<string[]> {
* The result is obtained from the action input parameter 'languages' if that
* has been set, otherwise it is deduced as all languages in the repo that
* can be analysed.
*
* If no languages could be detected from either the workflow or the repository
* then throw an error.
*/
async function getLanguages(): Promise<string[]> {

@@ -468,6 +471,13 @@ async function getLanguages(): Promise<string[]> {
core.info("Automatically detected languages: " + JSON.stringify(languages));
}

// If the languages parameter was not given and no languages were
// detected then fail here as this is a workflow configuration error.
if (languages.length === 0) {
throw new Error("Did not detect any languages to analyze. " +
"Please update input in workflow or check that GitHub detects the correct languages in your repository.");
}

return languages;
}

@@ -515,11 +525,6 @@ async function loadConfig(configFile: string): Promise<Config> {
}

const languages = await getLanguages();
// If the languages parameter was not given and no languages were
// detected then fail here as this is a workflow configuration error.
if (languages.length === 0) {
throw new Error("Did not detect any languages to analyze. Please update input in workflow.");
}

const queries = {};
const pathsIgnore: string[] = [];

0 comments on commit 4896ba5

Please sign in to comment.