Skip to content

Commit 6a94b6e

Browse files
authored
eng-1828 Branch environment uses specific deployment, not branch tip (#1101)
1 parent 48b3eff commit 6a94b6e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/database/scripts/createEnv.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ const makeBranchEnv = async (vercel: Vercel, vercelToken: string) => {
8787
console.warn("No deployment for branch " + branch);
8888
return;
8989
}
90-
const url = result.deployments[0]!.url;
90+
const deployment = result.deployments[0];
91+
if (!deployment) throw new Error("Could not get deployment");
92+
const url = deployment.meta?.branchAlias ?? deployment.url;
9193
try {
9294
execSync(
9395
`vercel -t ${vercelToken} env pull --environment preview --git-branch ${branch} .env.branch`,

0 commit comments

Comments
 (0)