From e82dab3c132e331679d645f4711487604242ecd7 Mon Sep 17 00:00:00 2001 From: Kevin Turcios <106575910+KRRT7@users.noreply.github.com> Date: Mon, 13 Apr 2026 17:30:33 -0500 Subject: [PATCH] Update js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> --- .../(dashboard)/review-optimizations/[traceId]/action.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts b/js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts index e87c382d3..b625c9d07 100644 --- a/js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts +++ b/js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts @@ -384,6 +384,13 @@ export async function createPullRequest({ const authorizedRepository = ( authorizedEvent.event as { repository?: { full_name?: string | null } | null } ).repository + if ( + full_repo_name && + authorizedRepository?.full_name && + authorizedRepository.full_name !== full_repo_name + if (full_repo_name && !authorizedRepository?.full_name) { + return createErrorResponse("Repository not found for this optimization event") + } if ( full_repo_name && authorizedRepository?.full_name && @@ -391,6 +398,8 @@ export async function createPullRequest({ ) { return createErrorResponse("Repository mismatch for optimization event") } + return createErrorResponse("Repository mismatch for optimization event") + } const cfapiUrl = process.env.CODEFLASH_CFAPI_URL const session = await auth0.getAccessToken()