Documentation
¶
Overview ¶
Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package workflow contains GitHub workflow domain models and validation logic.
This package owns:
- parsed workflow modeling from provider parse flows,
- workflow YAML document modeling,
- workflow-level validation rules,
- trigger normalization/mapping helpers.
Emission and orchestration remain in provider/github root.
Index ¶
- func DenormalizeScheduleEvent(normalized map[string]any) []any
- func NormalizeOn(raw any, mapper func(any) (map[string]any, bool)) (map[string]any, error)
- func NormalizeOnEvent(event string, value map[string]any) map[string]any
- func TriggerBlockTypeForEventKey(event string, key string) (string, bool)
- func ValidateCron(expr string) error
- func ValidateModel(workflow ValidationModel) error
- func ValidatePermissions(raw any) error
- func ValidateSchedule(value map[string]any) error
- type Parsed
- type ValidationModel
- type YAMLDocument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DenormalizeScheduleEvent ¶
DenormalizeScheduleEvent is the inverse of normalizeScheduleEvent. It converts {cron: ["A", "B"]} back to [{cron: "A"}, {cron: "B"}] as required by GitHub Actions.
func NormalizeOn ¶
NormalizeOn converts the various YAML representations of 'on' into a uniform map.
func NormalizeOnEvent ¶
NormalizeOnEvent applies rename rules to an event's configuration map (e.g. input to inputs).
func TriggerBlockTypeForEventKey ¶
TriggerBlockTypeForEventKey returns the HCL block type for a given event and YAML key.
func ValidateCron ¶
ValidateCron checks that a cron expression has 5 fields with valid ranges.
func ValidateModel ¶
func ValidateModel(workflow ValidationModel) error
ValidateModel checks that a workflow has triggers and non-duplicate job references.
func ValidatePermissions ¶
ValidatePermissions checks that a permissions value uses known scopes and valid levels. Accepts a string shorthand ("read-all"/"write-all"), an empty map (all none), or a map of scope→level.
func ValidateSchedule ¶
ValidateSchedule validates all cron entries in a normalized schedule event value.
Types ¶
type ValidationModel ¶
ValidationModel contains the fields needed to validate a workflow definition.
type YAMLDocument ¶
YAMLDocument represents a parsed GitHub Actions workflow YAML document.