1
0
Fork 0
pull/790/head
Luke Tomlinson 2021-05-05 16:58:35 -04:00
parent fad1bf5141
commit c9cab86201
1 changed files with 11 additions and 7 deletions

View File

@ -601,13 +601,17 @@ export function argStringToArray(argString: string): string[] {
} }
// Strips INPUT_ environment variables to prevent them leaking to child processes // Strips INPUT_ environment variables to prevent them leaking to child processes
export function stripInputEnvironmentVariables(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv { export function stripInputEnvironmentVariables(
return Object.entries(env).filter(([key, value]) => { env: NodeJS.ProcessEnv
return !key.startsWith('INPUT_') ): NodeJS.ProcessEnv {
}).reduce((obj: NodeJS.ProcessEnv, [key, value]) => { return Object.entries(env)
obj[key] = value .filter(([key]) => {
return obj return !key.startsWith('INPUT_')
}, {}) })
.reduce((obj: NodeJS.ProcessEnv, [key, value]) => {
obj[key] = value
return obj
}, {})
} }
class ExecState extends events.EventEmitter { class ExecState extends events.EventEmitter {