Skip to content

Commit

Permalink
feat: prefilter on reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Dec 5, 2024
1 parent 5c5c5f7 commit 4ee571a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/home/fetch-github/fetch-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ async function fetchNotifications(): Promise<GitHubNotifications | null> {
// Pre-filter notifications by general rules (repo filtering and ignoring CI activity)
function preFilterNotifications(notifications: GitHubNotification[]): GitHubNotifications {
return notifications.filter((notification) => {
// Ignore CI activity notifications
if (notification.reason === "ci_activity") return false;
// Ignore based on reason
if (
["author", "comment", "ci_activity", "invitation", "member_feature_requested", "security_advisory_credit", "state_change", "team_mention"].includes(
notification.reason
)
) {
return false;
}

// Ignore notifications from repos that are not relevant
const repoName = notification.repository.full_name.split("/")[0];
Expand Down

0 comments on commit 4ee571a

Please sign in to comment.