misc
InputIssue
¶
MetadataOutput
¶
OutputField
¶
Bases: BaseModel
Digestible information about an output.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
... |
description |
str
|
... |
full_ref_name |
str
|
... |
short_ref_name |
str
|
... |
is_export |
bool
|
... |
Source code in m/github/actions/misc.py
create(step_id, output_model)
classmethod
¶
Create an instance of an output field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
step_id |
str
|
The id of the step. |
required |
output_model |
type[KebabModel]
|
The model to create it from. |
required |
Returns:
Type | Description |
---|---|
dict[str, OutputField]
|
An instance of the output field. |
Source code in m/github/actions/misc.py
get_metadata_output()
¶
Get the metadata output.
Returns:
Type | Description |
---|---|
MetadataOutput
|
An instance of the metadata output. |
Source code in m/github/actions/misc.py
expression_eval(gh_expression)
¶
get_inputs_outputs(run_function)
¶
Get the inputs and outputs of a run_function
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_function |
Callable[[KebabModel], Res[KebabModel]]
|
The function to obtain the inputs and outputs from. |
required |
Returns:
Type | Description |
---|---|
InputOutputs
|
A tuple of the inputs and outputs. |
Source code in m/github/actions/misc.py
input_env(name)
¶
is_export(field)
¶
Determine if a field is exported.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field |
FieldInfo
|
The field to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the field is exported. |
Source code in m/github/actions/misc.py
is_input_key(key)
¶
map_args(all_args, available_values, dict_key)
¶
Map the arguments to a new value using the available values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
all_args |
dict[str, str]
|
A dictionary with mappable values. |
required |
available_values |
dict[str, str]
|
A dictionary with available values. |
required |
dict_key |
Callable[[str], str]
|
A transform function for the new key in the map. |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
A mapped dictionary. |
Source code in m/github/actions/misc.py
verify_inputs(input_model, args, available_outputs)
¶
Verify the inputs.
This is used to make sure we declare valid arguments in each step along with valid accessible values from the global inputs or previous steps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_model |
type[KebabModel]
|
The model to use to verify the inputs. |
required |
args |
dict[str, str]
|
The arguments to verify. |
required |
available_outputs |
dict[str, str]
|
A dict of available outputs to use as inputs. |
required |
Returns:
Type | Description |
---|---|
list[InputIssue]
|
A list of issues. |