Help us shape the future of Go! Take the 2026 Go Developer Survey

pipeline

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package pipeline orchestrates the scan, resolve, check, and report flow for a single run.

Index

Constants

View Source
const PublisherEscalationCopy = "Ask the action maintainer to tag releases from a branch"

PublisherEscalationCopy is the standardized one-liner shown in any block where a SHA fell off-branch on the publisher side. Phrased as direct guidance so users know what to do next: ask the maintainer to tag from a branch.

View Source
const PublisherTagReleasesDocURL = "https://docs.github.com/en/actions/how-tos/create-and-publish-actions/manage-custom-actions#using-tags-for-release-management"

PublisherTagReleasesDocURL points to GitHub's guidance for action publishers on tagging releases from a branch. It's surfaced alongside lockfile-forgery findings to help users escalate to the action's maintainer when the pinned SHA is orphaned (off any branch) — a publisher behavior the consumer can't fix locally beyond re-pinning to a sane release.

Variables

This section is empty.

Functions

func CollectResolvable

func CollectResolvable(parsed []checks.ParsedWorkflow) ([]parserlock.ActionRef, []dep.Dependency)

CollectResolvable returns the deduplicated union of refs and existing deps across all parsed workflows. Use the returned slices to pre-warm the resolver caches once before per-workflow diagnostics.

func CollectUnrecordedResolvable

func CollectUnrecordedResolvable(parsed []checks.ParsedWorkflow, recordedKeys map[string]bool) ([]parserlock.ActionRef, []dep.Dependency)

CollectUnrecordedResolvable is like CollectResolvable but excludes refs whose NWO@Ref key appears in recordedKeys. Deps whose key is in recordedKeys are also excluded. Use this when per-dep lockfile trust has already seeded the resolver cache for recorded deps, so only genuinely new refs need network resolution.

func Diagnose

func Diagnose(ctx context.Context, paths []string, r *resolve.Resolver, store *lockfile.State, pool *pinpool.Pool) *checks.Report

Diagnose scans workflows and produces findings for each.

It is a backward-compatible wrapper around ParseAll, resolver pre-warming, and DiagnoseParsed. Newer callers can drive those phases directly to control UI progress.

func DiagnoseParsed

func DiagnoseParsed(ctx context.Context, parsed []checks.ParsedWorkflow, r *resolve.Resolver, store *lockfile.State, pool *pinpool.Pool) *checks.Report

DiagnoseParsed runs engine diagnostics for each pre-parsed workflow, assuming the resolver caches are warm (calls hit cache and stay silent). Returns a checks.Report aggregating per-workflow findings in input order.

func DocURLFor

func DocURLFor(c checks.Category) string

DocURLFor returns the documentation URL for a finding category, or "" when the category has no associated URL (e.g. checks.Valid).

func ParseAll

func ParseAll(paths []string, store *lockfile.State) []checks.ParsedWorkflow

ParseAll loads and parses every workflow path, returning a slice in input order. onScan, if non-nil, fires with 1-based progress before each workflow is parsed so the UI can render i/N without leaking resolver detail.

func ReleasesURL

func ReleasesURL(owner, repo, ref string) string

ReleasesURL returns the GitHub releases URL for an action. When ref looks like a tag, links to the specific release; otherwise links to the releases index so users can pick one.

Types

type RunOptions

type RunOptions struct {
	WorkflowPaths []string
	Resolver      *resolve.Resolver
	Store         *lockfile.State
	Pool          *pinpool.Pool
	Rescan        bool // re-verify all pins end-to-end

	// Resolver UX hooks — set these for interactive spinner mode.
	OnResolveProgress func(done, total int)
	// Profile receives phase timing when profiling is enabled.
	Profile *profile.Session
}

RunOptions configures the Run pipeline.

type RunResult

type RunResult struct {
	Report        *checks.Report
	Valid         bool
	SkippedRescan int // already-pinned workflows trusted without network calls
}

RunResult bundles the pipeline output.

func Run

func Run(ctx context.Context, opts RunOptions) (*RunResult, error)

Run executes the full diagnostic pipeline: parse → trust-check → resolve → diagnose.

Directories

Path Synopsis
Package checks implements the structural, misleading-sha, and resolver-bound validators run against parsed workflows.
Package checks implements the structural, misleading-sha, and resolver-bound validators run against parsed workflows.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL