mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Change order of checks in tryUploadSarifIfRunFailed
This commit is contained in:
Generated
+12
-11
@@ -169796,23 +169796,24 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) {
|
||||
return uploadResult ? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID } : {};
|
||||
}
|
||||
async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) {
|
||||
if (!isCodeScanningEnabled(config)) {
|
||||
return {
|
||||
upload_failed_run_skipped_because: "Code Scanning is not enabled."
|
||||
};
|
||||
}
|
||||
if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") {
|
||||
return {
|
||||
upload_failed_run_skipped_because: "Analyze Action completed successfully"
|
||||
};
|
||||
}
|
||||
try {
|
||||
return await maybeUploadFailedSarif(
|
||||
config,
|
||||
repositoryNwo,
|
||||
features,
|
||||
logger
|
||||
);
|
||||
if (isCodeScanningEnabled(config)) {
|
||||
return await maybeUploadFailedSarif(
|
||||
config,
|
||||
repositoryNwo,
|
||||
features,
|
||||
logger
|
||||
);
|
||||
} else {
|
||||
return {
|
||||
upload_failed_run_skipped_because: "Code Scanning is not enabled."
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
logger.debug(
|
||||
`Failed to upload a SARIF file for this failed CodeQL code scanning run. ${e}`
|
||||
|
||||
Reference in New Issue
Block a user