config

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: 4 Imported by: 0

Documentation

Overview

Package config loads actl's optional project config file, `.actl.yml`. It is the single home for "which debug slice am I running" — the job, the matrix combination, breakpoints, the runner image map, secrets/vars/env, and per-`environment:` overlays — so a real workflow can be debugged with a short `actl` instead of a flag soup.

Secrets are deliberately NOT inlinable here: `.actl.yml` is a committable file, so a `secrets:` map (top-level or under any environment) is a hard error pointing the user at `secret-file:` (a dotenv path, kept out of git). vars/env are not sensitive and may be inlined.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breakpoint

type Breakpoint struct {
	Index int
	Name  string
}

Breakpoint is a config breakpoint: either a zero-based step index or a step name. Index is -1 when Name is set. The core resolves names to indices against the job's steps (cmd/actl passes both forms through).

func (*Breakpoint) UnmarshalYAML

func (b *Breakpoint) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML accepts either an integer (step index) or a string (step name).

type CloudIdentity added in v0.2.0

type CloudIdentity struct {
	File    string `yaml:"file"`    // path to the brought credential (kept out of git, like secret-file)
	Ambient *bool  `yaml:"ambient"` // opt-in ambient fallback; nil = unset (GCP/AWS only)
}

CloudIdentity is one cloud's identity config: a brought-credential file (GCP SA key JSON / Azure SP creds JSON / AWS keys dotenv) and an opt-in ambient flag (GCP/AWS).

type Config

type Config struct {
	Workflow     string                `yaml:"workflow"`
	Job          string                `yaml:"job"`
	Event        string                `yaml:"event"`
	Matrix       map[string]string     `yaml:"matrix"`
	WithDeps     *bool                 `yaml:"with-deps"`
	Images       map[string]string     `yaml:"images"`
	Breakpoints  []Breakpoint          `yaml:"breakpoints"`
	Workdir      string                `yaml:"workdir"`
	Source       string                `yaml:"source"`
	SecretFile   string                `yaml:"secret-file"`
	Vars         map[string]string     `yaml:"vars"`
	Env          map[string]string     `yaml:"env"`
	Secrets      yaml.Node             `yaml:"secrets"` // inline secrets are rejected (see validate)
	Environments map[string]EnvOverlay `yaml:"environments"`
	Inputs       map[string]string     `yaml:"inputs"`
	Needs        map[string]Need       `yaml:"needs"`
	Identity     Identity              `yaml:"identity"`
}

Config is the parsed `.actl.yml`. Every field is optional; a CLI flag overrides its config counterpart, which overrides the built-in default (see cmd/actl). Secrets are file-only: the `Secrets` nodes exist solely so the loader can reject an inline map with a friendly message rather than silently ignoring it.

func Load

func Load(path string, explicit bool) (*Config, error)

Load reads and validates `.actl.yml` at path. A missing file is not an error when the path is the default (explicit=false): it returns (nil, nil) so the caller proceeds on flags alone. When explicit (the user pointed -config at a file), a missing/unreadable file is reported. Unknown keys are rejected (KnownFields) to catch typos, and an inline `secrets:` map is rejected with a message pointing at secret-file:.

type EnvOverlay

type EnvOverlay struct {
	SecretFile string            `yaml:"secret-file"`
	Vars       map[string]string `yaml:"vars"`
	Secrets    yaml.Node         `yaml:"secrets"` // rejected (see validate)
}

EnvOverlay is a per-`environment:` overlay of secrets/vars on top of the flat defaults, applied when the debugged job targets that deployment environment. Like the top level, secrets come only via SecretFile; an inline `secrets:` map is rejected.

type Identity added in v0.2.0

type Identity struct {
	GCP   CloudIdentity `yaml:"gcp"`
	AWS   CloudIdentity `yaml:"aws"`
	Azure CloudIdentity `yaml:"azure"`
}

Identity configures cloud identity handling per cloud (CLAUDE.md §4). The default path is bring-a-credential (File); ambient personal login is an opt-in fallback (GCP/AWS only — Azure has no ambient mode, so its Ambient is ignored).

type Need

type Need struct {
	Result  string            `yaml:"result"`
	Outputs map[string]string `yaml:"outputs"`
}

Need seeds an upstream job's contribution to needs.* for isolated debugging, the config form of the -need flag.

Jump to

Keyboard shortcuts

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