Skip to content

Commit

Permalink
refactor: FE리뷰어에서 PR작성자는 제외하도록 코드 수정 #432
Browse files Browse the repository at this point in the history
  • Loading branch information
useon committed Dec 10, 2024
1 parent ecc87e6 commit 3a2cd99
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/fe-review-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
'rbgksqkr': '마루',
};
const feReviewers = ['useon', 'novice0840', 'rbgksqkr']
async function getReviews(owner, repo, prNumber) {
// 특정 PR의 리뷰 상태 가져오기
const reviews = await github.rest.pulls.listReviews({
Expand Down Expand Up @@ -74,11 +76,8 @@ jobs:
const messages = await Promise.all(
fePrs.map(async pr => {
console.log(pr, 'pr')
const reviews = await getReviews(owner, repo, pr.number);
console.log(reviews, 'reviews');
console.log(pr.requested_reviewers, 'requested_reviewers')
const requestedReviewers = ['useon', 'novice0840', 'rbgksqkr'];
const requestedReviewers = feReviewers.filter((reviewer) => reviewer !== pr.user.login) // PR 작성자 제외
// 리뷰 상태를 관리하는 Map 객체 생성
const reviewStates = new Map();
Expand Down Expand Up @@ -106,7 +105,7 @@ jobs:
// 리뷰를 시작하지 않은 리뷰어 추가
const notStartedReviewers = requestedReviewers.filter(
reviewer => !reviewStates.has(reviewer) && reviewer !== pr.user.login // PR 작성자 제외
reviewer => !reviewStates.has(reviewer)
);
console.log(notStartedReviewers, '리뷰를 시작하지 않은 리뷰어')
Expand Down

0 comments on commit 3a2cd99

Please sign in to comment.