This commit is contained in:
jhutchings1
2020-07-11 12:43:17 -07:00
parent f1569d58df
commit b63d497b0e
2 changed files with 16 additions and 13 deletions
+15 -11
View File
@@ -233,17 +233,21 @@ function getCodeQLForCmd(cmd: string): CodeQL {
return JSON.parse(output);
},
databaseAnalyze: async function(databasePath: string, sarifFile: string, querySuite: string) {
await exec.exec(cmd, [
'database',
'analyze',
util.getMemoryFlag(),
util.getThreadsFlag(),
databasePath,
'--format=sarif-latest',
'--output=' + sarifFile,
'--no-sarif-add-snippets',
querySuite
]);
try {
await exec.exec(cmd, [
'database',
'analyze',
util.getMemoryFlag(),
util.getThreadsFlag(),
databasePath,
'--format=sarif-latest',
'--output=' + sarifFile,
'--no-sarif-add-snippets',
querySuite
]);
} catch (error) {
throw new Error ("Got it!" + error.message)
}
}
};
}
+1 -2
View File
@@ -131,7 +131,7 @@ async function runQueries(databaseFolder: string, sarifFolder: string, config: c
try {
await codeql.databaseAnalyze(path.join(databaseFolder, database), sarifFile, querySuite);
} catch (analysisError) {
core.debug(analysisError.message);
core.debug("test test test" + analysisError.message);
if (analysisError.message.contains("exit code 32")) {
throw new Error('Unable to analyze ' + database + ' because CodeQL was unable to detect any code for that language. \n [Learn more](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/troubleshooting-code-scanning) about how to troubleshoot this error. ');
} else {
@@ -175,7 +175,6 @@ async function run() {
}
} catch (error) {
core.debug(error.message);
core.setFailed(error.message);
await util.reportActionFailed('finish', error.message, error.stack);
return;