validate_actions.domain_model.contexts¶
GitHub Actions context definitions and type system.
This module defines the context objects available in GitHub Actions workflows for expression validation. Contexts provide access to workflow runtime information, environment state, and inter-job communication.
Contexts are organized hierarchically and each property has a defined type for validation purposes. The type system supports GitHub Actions’ dynamic nature while enabling static analysis.
See GitHub’s official documentation: https://docs.github.com/en/actions/learn-github-actions/contexts
Classes
|
Container context for the current job. |
|
Type system for GitHub Actions context values. |
|
Root container for all GitHub Actions contexts. |
|
GitHub context - contains information about the workflow run. |
|
Inputs context - contains input parameters. |
|
Job context - contains information about the currently running job. |
|
Context for a specific job in the jobs context. |
|
Jobs context - contains information about jobs in the workflow. |
|
Matrix context - contains the matrix parameters for the current job. |
|
Context for a specific job referenced in needs. |
|
Outputs context for a job referenced in needs. |
|
Needs context - contains information about jobs defined as dependencies. |
|
Outputs context for job or step outputs. |
|
Runner context - contains information about the runner executing jobs. |
|
Secrets context - contains repository and organization secrets. |
|
Service context for a specific service container. |
|
Services context containing all service containers. |
|
Outputs context for a specific step. |
|
Context for a specific step in the steps context. |
|
Steps context - contains information about steps in the current job. |
|
Strategy context - contains information about the matrix execution strategy. |
|
Vars context - contains repository and organization variables. |
- class validate_actions.domain_model.contexts.ContextType(*values)[source]¶
Bases:
EnumType system for GitHub Actions context values.
Defines the possible types that context properties can have. Used for expression validation and type checking.
- class validate_actions.domain_model.contexts.GithubContext(type_=ContextType(), action=ContextType(), action_path=ContextType(), action_ref=ContextType(), action_repository=ContextType(), action_status=ContextType(), actor=ContextType(), actor_id=ContextType(), api_url=ContextType(), base_ref=ContextType(), env=ContextType(), event=ContextType(), event_name=ContextType(), event_path=ContextType(), graphql_url=ContextType(), head_ref=ContextType(), job=ContextType(), path=ContextType(), ref=ContextType(), ref_name=ContextType(), ref_protected=ContextType(), ref_type=ContextType(), repository=ContextType(), repository_id=ContextType(), repository_owner=ContextType(), repository_owner_id=ContextType(), repositoryUrl=ContextType(), retention_days=ContextType(), run_id=ContextType(), run_number=ContextType(), run_attempt=ContextType(), secret_source=ContextType(), server_url=ContextType(), sha=ContextType(), token=ContextType(), triggering_actor=ContextType(), workflow=ContextType(), workflow_ref=ContextType(), workflow_sha=ContextType(), workspace=ContextType())[source]¶
Bases:
objectGitHub context - contains information about the workflow run.
The github context contains information about the workflow run and the event that triggered the run. You can read most of the github context data in environment variables.
Ordered according to GitHub’s official documentation.
- Parameters:
type_ (ContextType | None)
action (ContextType | None)
action_path (ContextType | None)
action_ref (ContextType | None)
action_repository (ContextType | None)
action_status (ContextType | None)
actor (ContextType | None)
actor_id (ContextType | None)
api_url (ContextType | None)
base_ref (ContextType | None)
env (ContextType | None)
event (ContextType | None)
event_name (ContextType | None)
event_path (ContextType | None)
graphql_url (ContextType | None)
head_ref (ContextType | None)
job (ContextType | None)
path (ContextType | None)
ref (ContextType | None)
ref_name (ContextType | None)
ref_protected (ContextType | None)
ref_type (ContextType | None)
repository (ContextType | None)
repository_id (ContextType | None)
repository_owner (ContextType | None)
repository_owner_id (ContextType | None)
repositoryUrl (ContextType | None)
retention_days (ContextType | None)
run_id (ContextType | None)
run_number (ContextType | None)
run_attempt (ContextType | None)
secret_source (ContextType | None)
server_url (ContextType | None)
sha (ContextType | None)
token (ContextType | None)
triggering_actor (ContextType | None)
workflow (ContextType | None)
workflow_ref (ContextType | None)
workflow_sha (ContextType | None)
workspace (ContextType | None)
- class validate_actions.domain_model.contexts.RunnerContext(type_=ContextType(), name=ContextType(), os=ContextType(), arch=ContextType(), temp=ContextType(), tool_cache=ContextType(), debug=ContextType(), environment=ContextType())[source]¶
Bases:
objectRunner context - contains information about the runner executing jobs.
The runner context contains information about the runner that is executing the current job.
- Parameters:
type_ (ContextType | None)
name (ContextType | None)
os (ContextType | None)
arch (ContextType | None)
temp (ContextType | None)
tool_cache (ContextType | None)
debug (ContextType | None)
environment (ContextType | None)
- class validate_actions.domain_model.contexts.SecretsContext(type_=ContextType(), GITHUB_TOKEN=ContextType(), children_=<factory>)[source]¶
Bases:
objectSecrets context - contains repository and organization secrets.
The secrets context is used to access repository and organization secrets.
- Parameters:
type_ (ContextType | None)
GITHUB_TOKEN (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.VarsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectVars context - contains repository and organization variables.
The vars context is used to access repository and organization variables.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.ContainerContext(type_=ContextType(), id=ContextType(), network=ContextType())[source]¶
Bases:
objectContainer context for the current job.
- Parameters:
type_ (ContextType | None)
id (ContextType | None)
network (ContextType | None)
- class validate_actions.domain_model.contexts.ServiceContext(type_=None, network=ContextType(), ports=<factory>)[source]¶
Bases:
objectService context for a specific service container.
- Parameters:
type_ (ContextType | None)
network (ContextType | None)
ports (List[str])
- class validate_actions.domain_model.contexts.ServicesContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectServices context containing all service containers.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ServiceContext])
- class validate_actions.domain_model.contexts.JobContext(type_=ContextType(), container=<factory>, services=<factory>, status=ContextType())[source]¶
Bases:
objectJob context - contains information about the currently running job.
The job context contains information about the currently running job.
- Parameters:
type_ (ContextType | None)
container (ContainerContext)
services (ServicesContext)
status (ContextType | None)
- class validate_actions.domain_model.contexts.OutputsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectOutputs context for job or step outputs.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.JobVarContext(type_=None, result=ContextType(), outputs=<factory>)[source]¶
Bases:
objectContext for a specific job in the jobs context.
- Parameters:
type_ (ContextType | None)
result (ContextType | None)
outputs (OutputsContext)
- class validate_actions.domain_model.contexts.JobsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectJobs context - contains information about jobs in the workflow.
The jobs context contains information about jobs in the current workflow run.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, JobVarContext])
- class validate_actions.domain_model.contexts.StepOutputsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectOutputs context for a specific step.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.StepVarContext(type_=ContextType(), outputs=<factory>, conclusion=ContextType(), outcome=ContextType())[source]¶
Bases:
objectContext for a specific step in the steps context.
- Parameters:
type_ (ContextType | None)
outputs (StepOutputsContext)
conclusion (ContextType | None)
outcome (ContextType | None)
- class validate_actions.domain_model.contexts.StepsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectSteps context - contains information about steps in the current job.
The steps context contains information about the steps in the current job that have already run.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, StepVarContext])
- class validate_actions.domain_model.contexts.StrategyContext(type_=ContextType(), fail_fast=ContextType(), job_index=ContextType(), job_total=ContextType(), max_parallel=ContextType())[source]¶
Bases:
objectStrategy context - contains information about the matrix execution strategy.
The strategy context contains information about the matrix execution strategy for the current job.
- Parameters:
type_ (ContextType | None)
fail_fast (ContextType | None)
job_index (ContextType | None)
job_total (ContextType | None)
max_parallel (ContextType | None)
- class validate_actions.domain_model.contexts.MatrixContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectMatrix context - contains the matrix parameters for the current job.
The matrix context contains the matrix parameters defined in the workflow for the current job.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.NeedOutputsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectOutputs context for a job referenced in needs.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.NeedContext(type_=ContextType(), result=ContextType(), outputs=<factory>)[source]¶
Bases:
objectContext for a specific job referenced in needs.
- Parameters:
type_ (ContextType | None)
result (ContextType | None)
outputs (NeedOutputsContext)
- class validate_actions.domain_model.contexts.NeedsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectNeeds context - contains information about jobs defined as dependencies.
The needs context contains outputs from all jobs that are defined as dependencies of the current job.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, NeedContext])
- class validate_actions.domain_model.contexts.InputsContext(type_=ContextType(), children_=<factory>)[source]¶
Bases:
objectInputs context - contains input parameters.
The inputs context contains input properties passed to a reusable workflow, or to a manually triggered workflow.
- Parameters:
type_ (ContextType | None)
children_ (Dict[str, ContextType])
- class validate_actions.domain_model.contexts.Contexts(github=<factory>, vars=<factory>, secrets=<factory>, inputs=<factory>, runner=None, job=None, jobs=None, steps=<factory>, strategy=None, matrix=None, needs=<factory>)[source]¶
Bases:
objectRoot container for all GitHub Actions contexts.
Aggregates all available contexts following GitHub’s official documentation order. Context availability depends on the workflow execution scope.
- Parameters:
github (GithubContext)
vars (VarsContext)
secrets (SecretsContext)
inputs (InputsContext)
runner (RunnerContext | None)
job (JobContext | None)
jobs (JobsContext | None)
steps (StepsContext)
strategy (StrategyContext | None)
matrix (MatrixContext | None)
needs (NeedsContext)