File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { RuntimeError as RuntimeErrorClass } from "./Runtime";
1818import { EXIT_CODE_ABORTED , EXIT_CODE_TIMEOUT } from "@/common/constants/exitCodes" ;
1919import { log } from "@/node/services/log" ;
2020import { checkInitHookExists , createLineBufferedLoggers , getInitHookEnv } from "./initHook" ;
21+ import { NON_INTERACTIVE_ENV_VARS } from "@/common/constants/env" ;
2122import { streamProcessToLogger } from "./streamProcess" ;
2223import { expandTildeForSSH , cdCommandForSSH } from "./tildeExpansion" ;
2324import { getProjectName } from "@/node/utils/runtime/helpers" ;
@@ -106,11 +107,10 @@ export class SSHRuntime implements Runtime {
106107 // Add cd command if cwd is specified
107108 parts . push ( cdCommandForSSH ( options . cwd ) ) ;
108109
109- // Add environment variable exports
110- if ( options . env ) {
111- for ( const [ key , value ] of Object . entries ( options . env ) ) {
112- parts . push ( `export ${ key } =${ shescape . quote ( value ) } ` ) ;
113- }
110+ // Add environment variable exports (user env first, then non-interactive overrides)
111+ const envVars = { ...options . env , ...NON_INTERACTIVE_ENV_VARS } ;
112+ for ( const [ key , value ] of Object . entries ( envVars ) ) {
113+ parts . push ( `export ${ key } =${ shescape . quote ( value ) } ` ) ;
114114 }
115115
116116 // Add the actual command
Original file line number Diff line number Diff line change @@ -113,6 +113,21 @@ describeIntegration("Runtime integration tests", () => {
113113 expect ( result . stdout . trim ( ) ) . toBe ( "test-value" ) ;
114114 } ) ;
115115
116+ test . concurrent ( "sets NON_INTERACTIVE_ENV_VARS to prevent prompts" , async ( ) => {
117+ const runtime = createRuntime ( ) ;
118+ await using workspace = await TestWorkspace . create ( runtime , type ) ;
119+
120+ // Verify GIT_TERMINAL_PROMPT is set to 0 (prevents credential prompts)
121+ const result = await execBuffered (
122+ runtime ,
123+ 'echo "GIT_TERMINAL_PROMPT=$GIT_TERMINAL_PROMPT GIT_EDITOR=$GIT_EDITOR"' ,
124+ { cwd : workspace . path , timeout : 30 }
125+ ) ;
126+
127+ expect ( result . stdout ) . toContain ( "GIT_TERMINAL_PROMPT=0" ) ;
128+ expect ( result . stdout ) . toContain ( "GIT_EDITOR=true" ) ;
129+ } ) ;
130+
116131 test . concurrent ( "handles empty output" , async ( ) => {
117132 const runtime = createRuntime ( ) ;
118133 await using workspace = await TestWorkspace . create ( runtime , type ) ;
You can’t perform that action at this time.
0 commit comments