builder
assert_actions(actions)
¶
Assert that the actions instance is of type Action
or list[Action]
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actions |
Any
|
The actions instance to assert. |
required |
Returns:
Type | Description |
---|---|
Res[list[Action]]
|
A |
Source code in m/github/actions/builder.py
build_actions(actions_py_file, *, check, show_traceback)
¶
Create the actions metadata files as described by the actions file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actions_py_file |
str
|
The path to a python script containing the actions. |
required |
check |
bool
|
Check if generated files are up to date and skip writing them. |
required |
show_traceback |
bool
|
Display traceback in case of an issue. |
required |
Returns:
Type | Description |
---|---|
Res[None]
|
A |
Source code in m/github/actions/builder.py
process_action(py_path, actions_module, action, *, check)
¶
Process an action to either write or check the action file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
py_path |
str
|
The root directory of the actions. |
required |
actions_module |
str
|
The name of the module containing the actions. |
required |
action |
Action
|
The action to process. |
required |
check |
bool
|
If True, it verifies the action file is up to date. |
required |
Returns:
Type | Description |
---|---|
Res[int]
|
An |
Source code in m/github/actions/builder.py
process_actions(py_path, mod_name, actions, *, check, show_traceback)
¶
Iterate over each action to either write or check the action file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
py_path |
str
|
The root directory of the actions. |
required |
mod_name |
str
|
The name of the module containing the actions. |
required |
actions |
list[Action]
|
The list of actions to process. |
required |
check |
bool
|
If True, it verifies the action file is up to date. |
required |
show_traceback |
bool
|
Display traceback in case of an issue. |
required |
Returns:
Type | Description |
---|---|
Res[None]
|
An |
Source code in m/github/actions/builder.py
update_py_path(actions_py_file)
¶
Obtain the python path and module name from the actions file.
It also modifies the PYTHONPATH so that other files may be imported from the same directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
actions_py_file |
str
|
The path to a python script containing the actions. |
required |
Returns:
Type | Description |
---|---|
Res[tuple[str, str]]
|
A |