We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d661d71 commit ca761baCopy full SHA for ca761ba
packages/core/src/v3/apiClient/getBranch.ts
@@ -12,12 +12,18 @@ export function getBranch({
12
return specified;
13
}
14
15
- // not specified, so detect from process.env
+ // not specified, so detect our variable from process.env
16
const envVar = getEnvVar("TRIGGER_PREVIEW_BRANCH");
17
if (envVar) {
18
return envVar;
19
20
21
+ // detect the Vercel preview branch
22
+ const vercelPreviewBranch = getEnvVar("VERCEL_GIT_COMMIT_REF");
23
+ if (vercelPreviewBranch) {
24
+ return vercelPreviewBranch;
25
+ }
26
+
27
// not specified, so detect from git metadata
28
if (gitMeta?.commitRef) {
29
return gitMeta.commitRef;
0 commit comments