From 30da2e50b1798f023c9ecf0ff6d802cd26a4a2c1 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Sat, 23 Sep 2023 11:38:49 +0100 Subject: [PATCH] Patch Vercel integration for custom preview branches --- backend/src/integrations/sync.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/integrations/sync.ts b/backend/src/integrations/sync.ts index cb45a9d95..9d2a9ca56 100644 --- a/backend/src/integrations/sync.ts +++ b/backend/src/integrations/sync.ts @@ -941,7 +941,11 @@ const syncSecretsVercel = async ({ ? { teamId: integrationAuth.teamId } - : {}) + : {}), + ...(integration?.path + ? { + gitBranch: integration?.path + } : {}) }; const vercelSecrets: VercelSecret[] = ( @@ -960,7 +964,7 @@ const syncSecretsVercel = async ({ if ( integration.targetEnvironment === "preview" && - integration.path && + secret.gitBranch && integration.path !== secret.gitBranch ) { // case: secret on preview environment does not have same target git branch @@ -969,7 +973,7 @@ const syncSecretsVercel = async ({ return true; }); - + const res: { [key: string]: VercelSecret } = {}; for await (const vercelSecret of vercelSecrets) {