From 69969b98935b6b638043e3acea27c6399eda338e Mon Sep 17 00:00:00 2001 From: Srayash <146334722+Srayash@users.noreply.github.com> Date: Tue, 5 Nov 2024 06:53:17 +0530 Subject: [PATCH] fix: skip review events for PR authors (#537) --- scraper/src/github-scraper/parseEvents.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scraper/src/github-scraper/parseEvents.ts b/scraper/src/github-scraper/parseEvents.ts index 21cf13cc..131301de 100644 --- a/scraper/src/github-scraper/parseEvents.ts +++ b/scraper/src/github-scraper/parseEvents.ts @@ -202,13 +202,15 @@ export const parseEvents = async (events: IGitHubEvent[]) => { } break; case "PullRequestReviewEvent": - appendEvent(user, { - type: "pr_reviewed", - time: eventTime?.toISOString(), - title: `${event.repo.name}#${event.payload.pull_request.number}`, - link: event.payload.review.html_url, - text: event.payload.pull_request.title, - }); + if (event.payload.pull_request.user.login !== user.login) { + appendEvent(user, { + type: "pr_reviewed", + time: eventTime?.toISOString(), + title: `${event.repo.name}#${event.payload.pull_request.number}`, + link: event.payload.review.html_url, + text: event.payload.pull_request.title, + }); + } break; default: break;