Skip to content

Commit

Permalink
fix: Added Firebase initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
noahonyejese committed Jan 8, 2025
1 parent d42ea56 commit cdd78f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api/github/events/projects/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { initializeFirebase } from '@/server/firebase/server';
import { projectSync } from '@/server/github/syncs';
import { verifyGitHubRequest } from '@/server/security';
import { createError } from '@/utils/error-handling';
Expand Down Expand Up @@ -32,6 +33,8 @@ export const POST = async (req: NextRequest) => {
const body = JSON.parse(rawBody) as WebhookEventMap[WebhookEventName];
const event = req.headers.get('x-github-event') as WebhookEventName;

initializeFirebase();

if (event !== 'ping' && 'repository' in body) {
await projectSync(body.repository as Repository);
}
Expand Down

0 comments on commit cdd78f3

Please sign in to comment.