Update js/cf-webapp/src/app/(dashboard)/review-optimizations/[traceId]/action.ts

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
Kevin Turcios 2026-04-13 17:30:33 -05:00 committed by GitHub
parent 0fe3ca8c0a
commit e82dab3c13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,6 +384,13 @@ export async function createPullRequest({
const authorizedRepository = ( const authorizedRepository = (
authorizedEvent.event as { repository?: { full_name?: string | null } | null } authorizedEvent.event as { repository?: { full_name?: string | null } | null }
).repository ).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 ( if (
full_repo_name && full_repo_name &&
authorizedRepository?.full_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")
} }
return createErrorResponse("Repository mismatch for optimization event")
}
const cfapiUrl = process.env.CODEFLASH_CFAPI_URL const cfapiUrl = process.env.CODEFLASH_CFAPI_URL
const session = await auth0.getAccessToken() const session = await auth0.getAccessToken()