workflow

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package workflow is a thin, intentionally boring wrapper around act's pkg/model. It exists so the rest of actl depends on our types and helpers, not directly on act's parsing surface — making the act version we stand on a single, swappable seam.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(dir string) ([]string, error)

Discover returns the workflow files under dir/.github/workflows, sorted. It matches GitHub's own convention (*.yml and *.yaml in that directory). A missing .github/workflows directory is not an error — it yields an empty slice, so the caller can give a friendly "no workflow found" message.

func JobEnvironment

func JobEnvironment(path, jobID string) (string, error)

JobEnvironment returns the deployment environment a job targets (GHA's job-level `environment:` key), or "" when the job declares none. act's model drops this field entirely (model.Job has only `env:`, the env-var map — not the deployment environment), so actl reads it straight from the raw YAML. GHA allows two forms: a bare string (`environment: production`) or an object (`environment: {name: …}`); both yield the name. A missing job/file/key is "" with no error — the caller treats "no environment" the same whether the job lacks one or the file can't be read here (a real parse error surfaces in debugger.New).

func Load

func Load(path string, strict bool) (*model.Workflow, error)

Load reads and parses a single workflow file using act's parser.

strict mirrors act's own flag: when true the file is validated against the GitHub Actions schema and rejected on unknown keys.

Types

type StepKind

type StepKind string

StepKind is a human-facing label for how a step will execute. It collapses act's finer StepType enum into the v0.1 vocabulary we show in the TUI.

const (
	KindRun      StepKind = "run"      // a shell script
	KindDocker   StepKind = "docker"   // uses: docker://...
	KindLocal    StepKind = "local"    // uses: ./path (composite or node, in-repo)
	KindRemote   StepKind = "remote"   // uses: owner/repo@ref (composite/node/docker)
	KindReusable StepKind = "reusable" // uses: a reusable workflow (out of v0.1 scope)
	KindInvalid  StepKind = "invalid"  // neither run nor uses, or both
)

func KindOf

func KindOf(s *model.Step) StepKind

KindOf classifies a step for display.

Jump to

Keyboard shortcuts

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