From e6056fd73ebd0357dbd2d2bff89c169b9900edc3 Mon Sep 17 00:00:00 2001 From: Harjot Gill Date: Fri, 11 Aug 2023 23:10:28 -0700 Subject: [PATCH] do not submit review when it's disabled (#434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Summary by CodeRabbit ## Release Notes - **New Feature**: Enhanced the review submission process in `src/review.ts`. The update includes a final summary comment before submitting the review, improving clarity and communication. > 🎉 Here's to the code that's ever so bright, > > A new line added, enhancing our might. > > With summaries clear, we take flight, > > In the realm of code, it's a delightful sight! 🚀 --- dist/index.js | 4 ++-- src/review.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7a6379ac..cb3eaf6b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -7831,11 +7831,11 @@ ${reviewsSkipped.length > 0 `; // add existing_comment_ids_block with latest head sha summarizeComment += `\n${commenter.addReviewedCommitId(existingCommitIdsBlock, context.payload.pull_request.head.sha)}`; + // post the review + await commenter.submitReview(context.payload.pull_request.number, commits[commits.length - 1].sha, statusMsg); } // post the final summary comment await commenter.comment(`${summarizeComment}`, lib_commenter/* SUMMARIZE_TAG */.Rp, 'replace'); - // post the review - await commenter.submitReview(context.payload.pull_request.number, commits[commits.length - 1].sha, statusMsg); }; const splitPatch = (patch) => { if (patch == null) { diff --git a/src/review.ts b/src/review.ts index 7a857e1e..07bf2e59 100644 --- a/src/review.ts +++ b/src/review.ts @@ -730,17 +730,17 @@ ${ existingCommitIdsBlock, context.payload.pull_request.head.sha )}` + + // post the review + await commenter.submitReview( + context.payload.pull_request.number, + commits[commits.length - 1].sha, + statusMsg + ) } // post the final summary comment await commenter.comment(`${summarizeComment}`, SUMMARIZE_TAG, 'replace') - - // post the review - await commenter.submitReview( - context.payload.pull_request.number, - commits[commits.length - 1].sha, - statusMsg - ) } const splitPatch = (patch: string | null | undefined): string[] => {