From af30a46872a191062cf4f337f0efcbf9b09be9f8 Mon Sep 17 00:00:00 2001 From: Wei Han Date: Mon, 14 Oct 2024 18:49:38 -0700 Subject: [PATCH] Removed dependabot from live feed --- components/GitHubEvent.tsx | 3 ++- pages/index.tsx | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/GitHubEvent.tsx b/components/GitHubEvent.tsx index 47f08f7..fa429e4 100644 --- a/components/GitHubEvent.tsx +++ b/components/GitHubEvent.tsx @@ -8,7 +8,8 @@ import { GitHubEvent } from '../util'; function GitHubEventComponent(props: GitHubEvent): JSX.Element { const { type, actor, repo, payload, created_at } = props; const timePassed = moment(created_at).fromNow(); - const userLink = !actor.login.includes('[bot]') ? {`@${actor.login}`} : actor.login; + const userLink = {`@${actor.login}`}; + return ( <> {/*
*/} diff --git a/pages/index.tsx b/pages/index.tsx index c6c649c..cc4250f 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -102,9 +102,17 @@ export default function Home({

this is a live feed of our {numRepos} repositories

- {recentEvents.map((event: GitHubEvent) => ( - - ))} + {recentEvents + // Filter to remove bot accounts (dependabot, etc) + .filter( + (event: GitHubEvent) => + !['[bot]'].some((botAccount) => + event.actor.login.includes(botAccount), + ), + ) + .map((event: GitHubEvent) => ( + + ))}

see more activity{' '} on our org!