Push unsuccessful execution API error detection into upload library
This commit is contained in:
parent
7fc3c603aa
commit
e628ee0ae1
6 changed files with 53 additions and 32 deletions
14
lib/init-action-post-helper.js
generated
14
lib/init-action-post-helper.js
generated
|
|
@ -54,18 +54,8 @@ async function uploadFailedSarif(config, repositoryNwo, featureEnablement, logge
|
|||
await codeql.diagnosticsExport(sarifFile, category);
|
||||
core.info(`Uploading failed SARIF file ${sarifFile}`);
|
||||
const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger);
|
||||
if (uploadResult !== undefined && waitForProcessing) {
|
||||
try {
|
||||
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof Error && e.message.includes("unsuccessful execution")) {
|
||||
logger.info("Submitting a SARIF file for the failed run isn't yet supported, continuing.");
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (waitForProcessing) {
|
||||
await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true });
|
||||
}
|
||||
}
|
||||
async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, printDebugLogs, repositoryNwo, featureEnablement, logger) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue