reci.action_spec¶
Action contract model — parsed from action.yml metadata.
An ActionSpec captures the typed input/output contract of a GitHub
Action so that downstream modules (graph, compiler, validation) can reason
about data flow without fetching YAML at every step.
Functions
|
Extract the last path segment of an action ref, normalized. |
|
Build an |
|
Fetch action.yml from GitHub and return an |
|
Fetch and parse an |
|
Canonical form: lowercase, hyphens/spaces → underscores. |
|
Build an |
Classes
|
The typed contract of a single GitHub Action. |
|
One declared input of a GitHub Action. |
|
One declared output of a GitHub Action (see |
Exceptions
Raised when an action.yml cannot be retrieved. |
- exception reci.action_spec.ActionFetchError[source]¶
Bases:
ExceptionRaised when an action.yml cannot be retrieved.
- class reci.action_spec.ActionSpec(ref, inputs=<factory>, outputs=<factory>, composite=False)[source]¶
Bases:
objectThe typed contract of a single GitHub Action.
inputs and outputs are keyed by normalized name.
- class reci.action_spec.InputSpec(name, required=False, default=None, description='', original_name='')[source]¶
Bases:
objectOne declared input of a GitHub Action.
name is normalized (used for matching); original_name is the spelling in
action.yml(used when emitting, since GitHub does not map_to-).
- class reci.action_spec.OutputSpec(name, description='', original_name='')[source]¶
Bases:
objectOne declared output of a GitHub Action (see
InputSpec).
- reci.action_spec.action_local_name(ref)[source]¶
Extract the last path segment of an action ref, normalized.
- Return type:
>>> action_local_name('i2mint/wads/actions/run-tests@master') 'run_tests' >>> action_local_name('actions/checkout@v4') 'checkout'
- reci.action_spec.action_spec_from_declaration(ref, *, inputs=None, outputs=None)[source]¶
Build an
ActionSpecfrom inline recipe declarations.Used when the recipe manually annotates inputs/outputs for a
run:step or overrides the fetched metadata.- Return type:
- reci.action_spec.action_spec_from_ref(ref)[source]¶
Fetch action.yml from GitHub and return an
ActionSpec.- Return type:
- reci.action_spec.fetch_action_yml(ref)[source]¶
Fetch and parse an
action.ymlfrom GitHub.Tries the raw URL first, then a fallback with
action.yaml.- Return type:
- reci.action_spec.normalize_name(name)[source]¶
Canonical form: lowercase, hyphens/spaces → underscores.
- Return type:
>>> normalize_name('python-version') 'python_version' >>> normalize_name('Root Dir') 'root_dir'
- reci.action_spec.parse_action_spec(ref, *, action_yml_data)[source]¶
Build an
ActionSpecfrom a ref string and parsed action.yml data.- Return type: