Documentation
¶
Overview ¶
Package workflowfile owns the parsed workflow YAML representation: loading, extraction of action refs, local composite discovery, and comment-preserving rewriting. It intentionally has no dependency on the lockfile or resolver packages.
Index ¶
- func DiscoverWorkflows() ([]string, error)
- func DiscoverWorkflowsIn(dir string) ([]string, error)
- func ExtractLocalCompositeRefs(workflowPath string, localPaths []string) ([]parserlock.ActionRef, []string)
- func IsHostedRunnerLabel(label string) bool
- func KeyFromPath(workflowPath string) string
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverWorkflows ¶
DiscoverWorkflows finds all workflow files in .github/workflows/ relative to the current directory. Returns nil if the directory doesn't exist.
func DiscoverWorkflowsIn ¶
DiscoverWorkflowsIn finds all workflow files (*.yml, *.yaml) in dir. Returns nil if the directory doesn't exist.
func ExtractLocalCompositeRefs ¶
func ExtractLocalCompositeRefs(workflowPath string, localPaths []string) ([]parserlock.ActionRef, []string)
ExtractLocalCompositeRefs reads action.yml files from local paths relative to the workflow file's directory and returns any repository action refs found in their steps.
func IsHostedRunnerLabel ¶ added in v0.0.15
IsHostedRunnerLabel reports whether label is a known GitHub-hosted runner label. Matches case-insensitively against the label set from github/hosted-compute-core imageconfigs.
func KeyFromPath ¶
KeyFromPath converts a workflow path discovered on disk (relative to the repo root or cwd) into the repo-relative key used inside the lockfile.
Types ¶
type File ¶
File is the parsed workflow YAML the CLI rewrites in-place. It carries the original byte content alongside the parsed node tree so RewriteActionRefs can do anchored, comment-preserving substitution.
func (*File) ExtractActionRefs ¶
func (f *File) ExtractActionRefs() ([]parserlock.ActionRef, []string, []string)
ExtractActionRefs finds all uses: references to repository actions in the workflow.
func (*File) ExtractRunsOnLabels ¶ added in v0.0.15
ExtractRunsOnLabels returns the set of runs-on labels across all jobs in the workflow. Each distinct label appears once (case-preserved). Expression-based labels (containing "${") are returned as-is.
func (*File) HasNonHostedRunnerLabels ¶ added in v0.0.15
HasNonHostedRunnerLabels reports whether any job in the workflow uses a runs-on label that is not a known GitHub-hosted runner. Returns false when the workflow has no jobs or no runs-on keys (run-only workflows have no action refs to pin, so they are excluded separately).