Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionMapping ¶
type ActionMapping struct{ Mapping }
ActionMapping represents the top-level action metadata mapping.
func (ActionMapping) EachStep ¶
func (m ActionMapping) EachStep(fn func(step StepMapping))
EachStep iterates over all steps in a composite action's runs.steps. It is a no-op for non-composite actions (where runs.steps does not exist). It silently skips malformed sections, consistent with WorkflowMapping.EachStep.
type ActionRef ¶
type ActionRef struct {
// contains filtered or unexported fields
}
ActionRef holds a step's "uses" value together with its source token.
func NewActionRef ¶
NewActionRef creates a new ActionRef.
func (ActionRef) IsDocker ¶
IsDocker reports whether the action is a Docker reference (starts with "docker://").
func (ActionRef) IsLocal ¶
IsLocal reports whether the action is a local path reference (starts with "./").
func (ActionRef) OwnerRepo ¶
OwnerRepo extracts the owner and repo from the action path (before "@"). Returns empty strings for local actions, Docker actions, or paths that do not contain at least owner/repo.
func (ActionRef) Ref ¶
Ref returns the git reference portion after the last "@". Returns an empty Ref if there is no "@".
func (ActionRef) RefToken ¶
RefToken returns a token pointing to just the ref portion (after "@"). If there is no "@", it returns the full token.
type Mapping ¶
type Mapping struct{ *ast.MappingNode }
Mapping wraps *ast.MappingNode with common navigation methods.
func (Mapping) FindKey ¶
func (m Mapping) FindKey(key string) *ast.MappingValueNode
FindKey searches for a key in the mapping and returns the corresponding MappingValueNode, or nil if not found.
func (Mapping) FirstToken ¶
FirstToken walks the token chain backward to the first non-comment token in the file. It returns a copy of that token with its Value trimmed to the first byte. Returns nil if the MappingNode is nil.
type StepMapping ¶
type StepMapping struct {
Mapping
}
StepMapping represents a step-level mapping.
func (StepMapping) Uses ¶
func (s StepMapping) Uses() (ActionRef, bool)
Uses extracts the ActionRef from the step's "uses" key. Returns (ActionRef, false) if the step has no "uses" key or the value is not a string/literal node.
func (StepMapping) With ¶
func (s StepMapping) With() (Mapping, bool)
With returns the "with" mapping from the step. Returns (Mapping, false) if the step has no "with" key or the value is not a mapping node.
type WorkflowMapping ¶
type WorkflowMapping struct{ Mapping }
WorkflowMapping represents the top-level workflow mapping.
func (WorkflowMapping) EachJob ¶ added in v0.6.1
func (w WorkflowMapping) EachJob(fn func(jobKeyToken *token.Token, job JobMapping))
EachJob iterates over all jobs in the workflow. It silently skips malformed sections (missing jobs key, non-mapping values, etc.) because structural validation is handled by the required invalid-workflow rule, which gates all non-required rules.
func (WorkflowMapping) EachStep ¶
func (w WorkflowMapping) EachStep(fn func(step StepMapping))
EachStep iterates over all steps across all jobs in the workflow. It silently skips malformed sections (missing jobs, non-mapping jobs, etc.) because structural validation is handled by the required invalid-workflow rule, which gates all non-required rules.