Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
post review only when comments are there (#379)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by openai -->
### Summary by OpenAI

**Chore:**
- Added an early return in `submitReview` function of `src/commenter.ts`
when there are no review comments, improving efficiency by avoiding
unnecessary operations.

> 🎉 Here's to the code that's lean and mean,
> No more wasted cycles, it's a well-oiled machine. 🚀
> When comments are none, it knows what to shun,
> Celebrating small wins, this battle is won! 🏆
<!-- end of auto-generated comment: release notes by openai -->
  • Loading branch information
harjotgill authored Jul 24, 2023
1 parent f1cf28d commit 955c447
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ ${COMMENT_TAG}`
}

async submitReview(pullNumber: number, commitId: string) {
if (this.reviewCommentsBuffer.length === 0) {
return
}
for (const comment of this.reviewCommentsBuffer) {
const comments = await this.getCommentsAtRange(
pullNumber,
Expand Down

0 comments on commit 955c447

Please sign in to comment.