Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 992 Bytes

File metadata and controls

42 lines (23 loc) · 992 Bytes

@google-github-actions/actions-utils


@google-github-actions/actions-utils / env / stubEnv

Function: stubEnv()

stubEnv(input, target): () => void

Defined in: env.ts:35

stubEnv accepts an input dictionary and sets the provided environment variables in the current process environment. Values set to "undefined" are deleted from the environment.

The function is only safe for concurrent use if the target is safe for concurrent use. The function itself provides no locking.

Parameters

input

ProcessEnv

Map of string value pairs to set in the new environment.

target

ProcessEnv = process.env

Target map to set and restore (defaults to process.env).

Returns

Function that restores the environment.

(): void

Returns

void