File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/build/src/extensions/core Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ export function syncVercelEnvVars(options?: {
55 projectId ?: string ;
66 vercelAccessToken ?: string ;
77 vercelTeamId ?: string ;
8+ branch ?: string ;
89} ) : BuildExtension {
910 const sync = syncEnvVars ( async ( ctx ) => {
1011 const projectId =
@@ -13,6 +14,17 @@ export function syncVercelEnvVars(options?: {
1314 options ?. vercelAccessToken ?? process . env . VERCEL_ACCESS_TOKEN ?? ctx . env . VERCEL_ACCESS_TOKEN ;
1415 const vercelTeamId =
1516 options ?. vercelTeamId ?? process . env . VERCEL_TEAM_ID ?? ctx . env . VERCEL_TEAM_ID ;
17+ const branch =
18+ options ?. branch ??
19+ process . env . VERCEL_PREVIEW_BRANCH ??
20+ ctx . env . VERCEL_PREVIEW_BRANCH ??
21+ ctx . branch ;
22+
23+ console . debug ( "syncVercelEnvVars()" , {
24+ projectId,
25+ vercelTeamId,
26+ branch,
27+ } ) ;
1628
1729 if ( ! projectId ) {
1830 throw new Error (
@@ -42,7 +54,7 @@ export function syncVercelEnvVars(options?: {
4254 }
4355 const params = new URLSearchParams ( { decrypt : "true" } ) ;
4456 if ( vercelTeamId ) params . set ( "teamId" , vercelTeamId ) ;
45- if ( ctx . branch ) params . set ( "gitBranch" , ctx . branch ) ;
57+ if ( branch ) params . set ( "gitBranch" , branch ) ;
4658 const vercelApiUrl = `https://api.vercel.com/v8/projects/${ projectId } /env?${ params } ` ;
4759
4860 try {
You can’t perform that action at this time.
0 commit comments