Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export async function action({ request, params }: ActionFunctionArgs) {
environment: {
select: {
apiKey: true,
parentEnvironment: {
select: {
apiKey: true,
},
},
},
},
},
Expand All @@ -52,7 +57,13 @@ export async function action({ request, params }: ActionFunctionArgs) {
return json({ error: "Waitpoint not found" }, { status: 404 });
}

if (!verifyHttpCallbackHash(waitpoint.id, hash, waitpoint.environment.apiKey)) {
if (
!verifyHttpCallbackHash(
waitpoint.id,
hash,
waitpoint.environment.parentEnvironment?.apiKey ?? waitpoint.environment.apiKey
)
) {
return json({ error: "Invalid URL, hash doesn't match" }, { status: 401 });
}

Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/v3/apiClientManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export class APIClientManagerAPI {

get branchName(): string | undefined {
const config = this.#getConfig();
const value = config?.previewBranch ?? getEnvVar("TRIGGER_PREVIEW_BRANCH") ?? undefined;
const value =
config?.previewBranch ??
getEnvVar("TRIGGER_PREVIEW_BRANCH") ??
getEnvVar("VERCEL_GIT_COMMIT_REF") ??
undefined;
return value ? value : undefined;
}

Expand Down