report status as failure if upload fails

This commit is contained in:
Joshua Hale 2020-04-30 16:28:53 +01:00
parent 1cdde3eb41
commit 26e955cfa3
No known key found for this signature in database
GPG key ID: 4823A6DB4B5E32E1
6 changed files with 42 additions and 19 deletions

View file

@ -9,17 +9,19 @@ async function run() {
}
try {
await upload_lib.upload(core.getInput('sarif_file'));
if (await upload_lib.upload(core.getInput('sarif_file'))) {
await util.reportActionSucceeded('upload-sarif');
} else {
await util.reportActionFailed('upload-sarif', 'upload');
}
} catch (error) {
core.setFailed(error.message);
await util.reportActionFailed('upload-sarif', error.message, error.stack);
return;
}
await util.reportActionSucceeded('upload-sarif');
}
run().catch(e => {
core.setFailed("upload-sarif action failed: " + e);
core.setFailed("codeql/upload-sarif action failed: " + e);
console.log(e);
});