Skip to content

Commit 91edebd

Browse files
committed
Handle API versions that reject unsuccessful executions
1 parent 7cef3cf commit 91edebd

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

lib/init-action-post-helper.js

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post-helper.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init-action-post-helper.ts

+15-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,21 @@ async function uploadFailedSarif(
6363
logger
6464
);
6565
if (uploadResult !== undefined && waitForProcessing) {
66-
await uploadLib.waitForProcessing(
67-
repositoryNwo,
68-
uploadResult.sarifID,
69-
logger
70-
);
66+
try {
67+
await uploadLib.waitForProcessing(
68+
repositoryNwo,
69+
uploadResult.sarifID,
70+
logger
71+
);
72+
} catch (e) {
73+
if (e instanceof Error && e.message.includes("unsuccessful execution")) {
74+
logger.info(
75+
"Submitting a SARIF file for the failed run isn't yet supported, continuing."
76+
);
77+
} else {
78+
throw e;
79+
}
80+
}
7181
}
7282
}
7383

0 commit comments

Comments
 (0)