1
0
Fork 0
pull/900/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,10 +601,14 @@ export function argStringToArray(argString: string): string[] {
}
// Strips INPUT_ environment variables to prevent them leaking to child processes
export function stripInputEnvironmentVariables(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
return Object.entries(env).filter(([key, value]) => {
export function stripInputEnvironmentVariables(
env: NodeJS.ProcessEnv
): NodeJS.ProcessEnv {
return Object.entries(env)
.filter(([key]) => {
return !key.startsWith('INPUT_')
}).reduce((obj: NodeJS.ProcessEnv, [key, value]) => {
})
.reduce((obj: NodeJS.ProcessEnv, [key, value]) => {
obj[key] = value
return obj
}, {})