Skip to content

Commit 71bc1a8

Browse files
committed
SDK: auto-detect the branch using the VERCEL_GIT_COMMIT_REF env var
1 parent ea853b2 commit 71bc1a8

File tree

1 file changed

+5
-1
lines changed
  • packages/core/src/v3/apiClientManager

1 file changed

+5
-1
lines changed

packages/core/src/v3/apiClientManager/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ export class APIClientManagerAPI {
4646

4747
get branchName(): string | undefined {
4848
const config = this.#getConfig();
49-
const value = config?.previewBranch ?? getEnvVar("TRIGGER_PREVIEW_BRANCH") ?? undefined;
49+
const value =
50+
config?.previewBranch ??
51+
getEnvVar("TRIGGER_PREVIEW_BRANCH") ??
52+
getEnvVar("VERCEL_GIT_COMMIT_REF") ??
53+
undefined;
5054
return value ? value : undefined;
5155
}
5256

0 commit comments

Comments
 (0)