validate_actions.pipeline_stages.builder

Builder stage that transformes parsed YAML data into a structured AST.

Classes

Builder(problems)

Abstract base class for workflow AST builders.

DefaultBuilder(problems)

Default implementation of the Builder stage for GitHub Actions workflows.

class validate_actions.pipeline_stages.builder.Builder(problems)[source]

Bases: ProcessStage[Dict[String, Any], Workflow]

Abstract base class for workflow AST builders.

The Builder stage transforms parsed YAML data into a structured AST representation that can be used for validation and analysis.

Parameters:

problems (Problems)

abstractmethod process(workflow_dict)[source]

Build a workflow AST from parsed YAML data.

Parameters:

workflow_dict (Dict[String, Any]) – Dictionary representation of the parsed workflow YAML, with String keys preserving position information

Returns:

Complete AST representation of the GitHub Actions workflow

Return type:

Workflow

class validate_actions.pipeline_stages.builder.DefaultBuilder(problems)[source]

Bases: Builder

Default implementation of the Builder stage for GitHub Actions workflows.

This class orchestrates the construction of a complete workflow AST by coordinating multiple specialized builders. It creates and manages builders for different workflow components (events, jobs, steps, shared components) and delegates the actual AST construction to a workflow builder.

The builder follows a hierarchical structure where: - Workflow contains events and jobs - Jobs contain steps and shared components - Steps use shared components and contexts

Parameters:

problems (Problems)

shared_components_builder

Builds reusable workflow components

Type:

DefaultSharedComponentsBuilder

events_builder

Builds workflow trigger events (push, pull_request, etc.)

Type:

DefaultEventsBuilder

steps_builder

Builds individual job steps with actions and commands

Type:

DefaultStepsBuilder

jobs_builder

Builds job definitions with their steps and configuration

Type:

DefaultJobsBuilder

workflow_builder

Top-level builder that orchestrates all components

Type:

DefaultWorkflowBuilder

process(workflow_dict)[source]

Build a complete workflow AST from parsed YAML data.

Delegates the AST construction to the workflow builder, which coordinates all sub-builders to create a fully structured representation of the workflow.

Parameters:

workflow_dict (Dict[String, Any]) – Dictionary representation of parsed workflow YAML, with String keys that preserve position information

Returns:

Complete AST representation of the GitHub Actions workflow,

including all events, jobs, steps, and shared components

Return type:

Workflow