fix: repair bad merge in review-optimizations authorization checks

Duplicate and mangled if-blocks from the merge of #2605 caused a syntax
error that broke type-checking.
This commit is contained in:
Kevin Turcios 2026-04-13 19:38:24 -05:00
parent 91b692c1a0
commit 1fada04c22

View file

@ -384,10 +384,6 @@ 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) { if (full_repo_name && !authorizedRepository?.full_name) {
return createErrorResponse("Repository not found for this optimization event") return createErrorResponse("Repository not found for this optimization event")
} }
@ -398,8 +394,6 @@ 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()