Skip to content

Commit

Permalink
changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry-Hong committed Oct 28, 2024
1 parent 2dc38b2 commit 3df81b1
Show file tree
Hide file tree
Showing 2 changed files with 523 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/on-pull-request-review-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ jobs:
script: |
/** For more details how "context object" looks like, see: https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts */
const {data: reviewComments} = await github.rest.pulls.listReviewComments({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}) ?? [];
console.log("payload", JSON.stringify(context.payload));
/** For more details how "comment object" looks like, see: https://docs.github.com/ko/rest/pulls/comments?apiVersion=2022-11-28#list-review-comments-on-a-pull-request */
const recentComment = reviewComments.at(-1);
const reviewId = recentComment.pull_request_review_id;
const reviewId = context.payload.review.id // reviewCommenes.at(-1).id 에서 뽑아오게 되는 경우, 동시성 문제가 발생할 수 있으므로 context에서 추출하도록 한다.
const reviewCommentsInThisReview = reviewComments.filter(comment => comment.pull_request_review_id === reviewId);
const reviewCommentsNotInReply = reviewCommentsInThisReview.filter(comment => comment?.in_reply_to_id == null);
Expand Down
Loading

0 comments on commit 3df81b1

Please sign in to comment.