File tree Expand file tree Collapse file tree
packages/cli-v3/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -788,7 +788,11 @@ export async function syncEnvVarsWithServer(
788788 Object . keys ( secretParentEnvVars ?? { } ) . length > 0 ;
789789
790790 // The import API applies isSecret per call, so secret and non-secret vars go in separate calls.
791- let result : Awaited < ReturnType < typeof apiClient . importEnvVars > > | undefined ;
791+ // Default to success so an all-empty call (no vars to sync) is a no-op, not undefined.
792+ let result : Awaited < ReturnType < typeof apiClient . importEnvVars > > = {
793+ success : true ,
794+ data : { success : true } ,
795+ } ;
792796
793797 if ( hasNonSecret ) {
794798 result = await apiClient . importEnvVars ( projectRef , environmentSlug , {
@@ -798,7 +802,7 @@ export async function syncEnvVarsWithServer(
798802 } ) ;
799803 }
800804
801- if ( hasSecret && ( ! result || result . success ) ) {
805+ if ( hasSecret && result . success ) {
802806 result = await apiClient . importEnvVars ( projectRef , environmentSlug , {
803807 variables : secretEnvVars ?? { } ,
804808 parentVariables : secretParentEnvVars ,
@@ -807,7 +811,7 @@ export async function syncEnvVarsWithServer(
807811 } ) ;
808812 }
809813
810- return result ! ;
814+ return result ;
811815}
812816
813817async function failDeploy (
You can’t perform that action at this time.
0 commit comments