mirror of https://github.com/actions/toolkit
Lint
parent
fad1bf5141
commit
c9cab86201
|
@ -601,10 +601,14 @@ 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
|
||||||
|
): NodeJS.ProcessEnv {
|
||||||
|
return Object.entries(env)
|
||||||
|
.filter(([key]) => {
|
||||||
return !key.startsWith('INPUT_')
|
return !key.startsWith('INPUT_')
|
||||||
}).reduce((obj: NodeJS.ProcessEnv, [key, value]) => {
|
})
|
||||||
|
.reduce((obj: NodeJS.ProcessEnv, [key, value]) => {
|
||||||
obj[key] = value
|
obj[key] = value
|
||||||
return obj
|
return obj
|
||||||
}, {})
|
}, {})
|
||||||
|
|
Loading…
Reference in New Issue