Skip to content

Commit 3d1bcad

Browse files
committed
fix typecheck
1 parent 8f1fd3b commit 3d1bcad

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

internal-packages/rbac/src/bearerCredentials.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { Result } from "@trigger.dev/core/v3";
21
import { isAdditionalApiKey } from "@trigger.dev/core/v3/apiKeys";
32
import { extractJWTSub, isPublicJWT, validateJWT } from "@trigger.dev/core/v3/jwt";
43
import { isDefaultDevBranch, sanitizeBranchName } from "@trigger.dev/core/v3/utils/gitBranch";
@@ -382,10 +381,14 @@ type EnvironmentWithBranches = Prisma.RuntimeEnvironmentGetPayload<{
382381
include: ReturnType<typeof environmentInclude>;
383382
}>;
384383

384+
type BranchResolution =
385+
| [error: string, environment: null]
386+
| [error: null, environment: AuthenticatedEnvironment];
387+
385388
function resolveBranch(
386389
environment: EnvironmentWithBranches,
387390
branchName: string | null
388-
): Result<AuthenticatedEnvironment, string> {
391+
): BranchResolution {
389392
if (environment.type === "PREVIEW" && !branchName) {
390393
return ["x-trigger-branch header required for preview env", null];
391394
}

0 commit comments

Comments
 (0)