matrix

package
v1.229.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal[T any](entries []T) ([]byte, error)

Marshal serializes matrix entries to compact JSON. Nil entries are normalized to an empty slice to produce {"include":[]} instead of {"include":null}.

func WriteOutput

func WriteOutput[T any](entries []T, outputFile string) error

WriteOutput writes the matrix output to stdout or a file. If outputFile is specified (for $GITHUB_OUTPUT), writes in key=value format. Otherwise, writes JSON to stdout.

Types

type Entry

type Entry struct {
	Stack         string `json:"stack"`
	Component     string `json:"component"`
	ComponentPath string `json:"component_path"`
	ComponentType string `json:"component_type"`
}

Entry represents a single entry in the matrix include array for stack/component-shaped matrices (`atmos describe affected`/`atmos list instances --format=matrix`).

type Output

type Output[T any] struct {
	Include []T `json:"include"`
}

Output represents the GitHub Actions matrix strategy format. Generic over the entry type so any caller with its own include-row shape (e.g. stack/component below, or a CI job's own shard/packages row) can reuse the same JSON/$GITHUB_OUTPUT plumbing instead of reimplementing it.

Jump to

Keyboard shortcuts

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