Skip to content

Commit

Permalink
Removed dependabot from live feed
Browse files Browse the repository at this point in the history
  • Loading branch information
cweihan01 committed Oct 15, 2024
1 parent 8a12750 commit af30a46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/GitHubEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]') ? <ELink link={`https://github.com/${actor.login}`}>{`@${actor.login}`}</ELink> : actor.login;
const userLink = <ELink link={`https://github.com/${actor.login}`}>{`@${actor.login}`}</ELink>;

return (
<>
{/* <div className="card" style={{marginTop: "20px"}}> */}
Expand Down
14 changes: 11 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ export default function Home({
<p>this is a live feed of our {numRepos} repositories</p>
<div className="card">
<div className="card-body">
{recentEvents.map((event: GitHubEvent) => (
<GitHubEventComponent {...event} key={event.id} />
))}
{recentEvents
// Filter to remove bot accounts (dependabot, etc)
.filter(
(event: GitHubEvent) =>
!['[bot]'].some((botAccount) =>
event.actor.login.includes(botAccount),
),
)
.map((event: GitHubEvent) => (
<GitHubEventComponent {...event} key={event.id} />
))}
<p>
see more activity{' '}
<ELink link="https://github.com/uclaacm/">on our org</ELink>!
Expand Down

0 comments on commit af30a46

Please sign in to comment.