Skip to content

Commit eb4dfc4

Browse files
committed
Default 브랜치로 Merging 되는 경우 리뷰하지 못하도록 수정
1 parent b5f8f8d commit eb4dfc4

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/kotlin/com/project/codereview/core/dto/GithubPayloadDtos.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ data class PullRequestPayload(
2828
val prNumber = _urls[5]
2929

3030
val hasReviewRequestLabel get() = labels.any { it.name == "review-bot" }
31+
val isMergingToDefaultBranch get() = head.repo.default_branch == base.ref
3132
}
3233

3334
@JsonIgnoreProperties(ignoreUnknown = true)

src/main/kotlin/com/project/codereview/core/service/CodeReviewFacade.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class CodeReviewFacade(
4545
return@coroutineScope
4646
}
4747

48+
if (pullRequestPayload.isMergingToDefaultBranch) {
49+
logger.info("Ignored LABELED: merging to default branch")
50+
return@coroutineScope
51+
}
52+
4853
withPrContexts(pullRequestPayload, payload) { contexts ->
4954
reviewJobQueue.enqueue(payload, contexts, REVIEW_MODEL)
5055
}

0 commit comments

Comments
 (0)