Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed dependabot from live feed #204

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading