Skip to content

Commit

Permalink
Handle API versions that reject unsuccessful executions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Nov 25, 2022
1 parent 7cef3cf commit 91edebd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
12 changes: 11 additions & 1 deletion lib/init-action-post-helper.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/init-action-post-helper.js.map

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

20 changes: 15 additions & 5 deletions src/init-action-post-helper.ts
Expand Up @@ -63,11 +63,21 @@ async function uploadFailedSarif(
logger
);
if (uploadResult !== undefined && waitForProcessing) {
await uploadLib.waitForProcessing(
repositoryNwo,
uploadResult.sarifID,
logger
);
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;
}
}
}
}

Expand Down

0 comments on commit 91edebd

Please sign in to comment.