fix: keep review progress best effort
This commit is contained in:
1 parent
4d73d1f30c
commit
6f2594f994
1 file changed
+11
-4
@@ -162,7 +162,10 @@ async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
const progress = prPayload.action === "synchronize"
|
||||
? await beginCommitReviewProgress(octokit, ref)
|
||||
? await beginCommitReviewProgress(octokit, ref).catch((progressError: unknown) => {
|
||||
logger.warn({ error: progressError, ...ref }, "Failed to publish review start progress; continuing review.");
|
||||
return undefined;
|
||||
})
|
||||
: undefined;
|
||||
try {
|
||||
await processPullRequest(
|
||||
@@ -171,9 +174,6 @@ async function main(): Promise<void> {
|
||||
config.reviewStrictness === "strict" ? "strict" : "normal",
|
||||
github.token
|
||||
);
|
||||
if (progress) {
|
||||
await finishCommitReviewProgress(octokit, { ...ref, ...progress });
|
||||
}
|
||||
} catch (error) {
|
||||
if (progress) {
|
||||
await finishCommitReviewProgress(octokit, { ...ref, ...progress, failed: true }).catch(
|
||||
@@ -184,6 +184,13 @@ async function main(): Promise<void> {
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
if (progress) {
|
||||
await finishCommitReviewProgress(octokit, { ...ref, ...progress }).catch(
|
||||
(progressError: unknown) => {
|
||||
logger.warn({ error: progressError, ...ref }, "Failed to publish review completion progress.");
|
||||
}
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user