mirror of
https://github.com/github/codeql-action.git
synced 2025-12-21 06:40:20 +08:00
Make submitting advanced analysis when default setup on a user error
This commit is contained in:
10
lib/upload-lib.js
generated
10
lib/upload-lib.js
generated
@@ -331,7 +331,10 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
|
||||
break;
|
||||
}
|
||||
else if (status === "failed") {
|
||||
throw new Error(`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`);
|
||||
const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`;
|
||||
throw areProcessingErrorsUserError(response.data.errors)
|
||||
? new util_1.UserError(message)
|
||||
: new Error(message);
|
||||
}
|
||||
else {
|
||||
util.assertNever(status);
|
||||
@@ -346,6 +349,11 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = {
|
||||
}
|
||||
}
|
||||
exports.waitForProcessing = waitForProcessing;
|
||||
function areProcessingErrorsUserError(processingErrors) {
|
||||
return (processingErrors.length === 1 &&
|
||||
processingErrors[0] ===
|
||||
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled");
|
||||
}
|
||||
/**
|
||||
* Checks the processing result for an unsuccessful execution. Throws if the
|
||||
* result is not a failure with a single "unsuccessful execution" error.
|
||||
|
||||
Reference in New Issue
Block a user