Module for working with environment variables.
Type | Description |
Function or value | Description | ||||
Full Usage:
get name
Parameters:
string
-
The name of the env var to get.
Returns: string
The value of the env var.
|
|
||||
Full Usage:
getAs name
Parameters:
string
-
The name of the env var to get.
Returns: 'T
The converted env var.
|
|
||||
Full Usage:
getAsOrFail name
Parameters:
string
-
The name of the env var to get.
Returns: Make<'T>
The env var if it exists and can be converted, an Error if it does not or cannot be converted.
|
Gets an environment variable by name and converts it to the specified type. This creates a Make that can be used in a step. When unable to get the env var, the step will fail.
Example
let getMyBool = EnvVar.getAsOrFail<bool> "MY_BOOL" let step = Step.create "release-notes" { let! myBool = getMyBool ... } |
||||
Full Usage:
getOption name
Parameters:
string
-
The name of the env var to get.
Returns: Option<string>
Some if env var exists, None if it does not exist.
|
|
||||
Full Usage:
getOptionAs name
Parameters:
string
-
The name of the env var to get.
Returns: 'T option
Some if the env var exists and can be converted, None if it does not exist or cannot be converted.
|
|
||||
Full Usage:
getOrFail name
Parameters:
string
-
The name of the env var to get.
Returns: Make<string>
The env var if it exists, or an Error if it does not.
|
Gets an environment variable by name. This creates a Make that can be used in a step. When unable to get the env var, the step will fail.
Example
let getToken = EnvVar.getOrFail "GITHUB_TOKEN" let step = Step.create "release-notes" { let! token = getToken ... } |
||||
Full Usage:
set (arg1, arg2)
Parameters:
string
arg1 : string
|
|
||||
Full Usage:
setMany envVars
Parameters:
seq<string * string>
-
A seq of pairs representing the names and values of the environment variables.
|
|