schema

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileShortRef added in v0.9.0

func CompileShortRef(value string) (*proto.Step_Reference, error)

func GitRefDir added in v0.5.0

func GitRefDir(dir string) func(*GitReference)

func ReadSteps

func ReadSteps(content string) (*Spec, *Step, error)

func WriteSteps

func WriteSteps(spec *Spec, step *Step) (string, error)

Types

type Exec

type Exec struct {
	// Command are the parameters to the system exec API. It does not invoke a shell.
	Command []string `json:"command" yaml:"command"`

	// WorkDir is the working directly in which `command` will be exec'ed.
	WorkDir *string `json:"work_dir,omitempty" yaml:"work_dir,omitempty"`
}

type GitReference

type GitReference struct {
	Dir  *string `yaml:"dir,omitempty"`
	Rev  string  `yaml:"rev"`
	Url  string  `yaml:"url"`
	File *string `yaml:"file,omitempty"`
}

GitReference is a reference to a step in a Git repository containing the full set of configuration options.

func NewGitReference added in v0.5.0

func NewGitReference(url, rev string, options ...func(*GitReference)) *GitReference

type Input

type Input struct {
	// Default is the default input value. Its type must match `type`.
	Default any `yaml:"default,omitempty"`

	// Sensitive implies the input is of sensitive nature and effort should be made to
	// prevent accidental disclosure.
	Sensitive *bool `yaml:"sensitive,omitempty"`

	// Type is the value type of the input.
	Type *InputType `yaml:"type,omitempty"`
}

type InputType

type InputType string

InputType is the value type of an input.

const InputTypeArray InputType = "array"
const InputTypeBoolean InputType = "boolean"
const InputTypeNumber InputType = "number"
const InputTypeString InputType = "string"
const InputTypeStruct InputType = "struct"

type OCIReference added in v0.5.0

type OCIReference struct {
	Registry   string  `yaml:"registry"`
	Repository string  `yaml:"repository"`
	Tag        string  `yaml:"tag"`
	Dir        *string `yaml:"dir,omitempty"`
	File       *string `yaml:"file,omitempty"`
}

OCIReference is a reference to a step in an OCI image that is hosted in an OCI repository.

type Output

type Output struct {
	// Default is the default output value.
	Default any `yaml:"default,omitempty"`

	// Sensitive implies the output is of sensitive nature and effort should be made
	// to prevent accidental disclosure.
	Sensitive *bool `yaml:"sensitive,omitempty"`

	// Type is the value type of the output.
	Type *OutputType `yaml:"type,omitempty"`
}

Output describes a single step output.

type OutputType

type OutputType string
const OutputTypeArray OutputType = "array"
const OutputTypeBoolean OutputType = "boolean"
const OutputTypeNumber OutputType = "number"
const OutputTypeString OutputType = "string"
const OutputTypeStruct OutputType = "struct"

type Outputs

type Outputs map[string]Output

type Reference

type Reference struct {
	Git *GitReference `yaml:"git,omitempty"`
	OCI *OCIReference `yaml:"oci,omitempty"`
}

Reference is a reference to a step in either a Git repository or an OCI image

type Signature

type Signature struct {
	Inputs  map[string]Input `yaml:"inputs,omitempty"`
	Outputs any              `yaml:"outputs,omitempty"`
}

Signature contains the inputs and outputs of the step.

func (*Signature) UnmarshalYAML

func (s *Signature) UnmarshalYAML(value *yaml.Node) error

type Spec

type Spec struct {
	Spec *Signature `yaml:"spec,omitempty"`
}

Spec is a document describing the interface of a step.

func (*Spec) Compile

func (spec *Spec) Compile() (*proto.Spec, error)

type Step

type Step struct {
	// Action is a GitHub action to run.
	Action *string `json:"action,omitempty" yaml:"action,omitempty"`

	// Delegate selects a step by name which will produce the outputs a run.
	Delegate *string `json:"delegate,omitempty" yaml:"delegate,omitempty"`

	// Env is a map of environment variable names to string values.
	Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`

	// Exec is a command to run.
	Exec *Exec `json:"exec,omitempty" yaml:"exec,omitempty"`

	// Inputs is a map of step input names to structured values.
	Inputs StepInputs `json:"inputs,omitempty" yaml:"inputs,omitempty"`

	// Name is a unique identifier for this step.
	Name *string `json:"name,omitempty" yaml:"name,omitempty"`

	// Outputs are the output values for a sequence. They can reference the outputs of
	// sub-steps.
	Outputs StepOutputs `json:"outputs,omitempty" yaml:"outputs,omitempty"`

	// Script is a shell script to evaluate.
	Script *string `json:"script,omitempty" yaml:"script,omitempty"`

	// Step is a reference to another step to invoke (deprecated)
	Step any `json:"step,omitempty" yaml:"step,omitempty"`

	// Func is a reference to a function to invoke
	Func any `json:"func,omitempty" yaml:"func,omitempty"`

	// Run is a list of sub-steps to run.
	Run []Step `json:"run,omitempty" yaml:"run,omitempty"`
}

Step is a unit of execution.

func (*Step) Compile

func (s *Step) Compile() (*proto.Definition, error)

func (*Step) CompileStep

func (s *Step) CompileStep() (*proto.Step, error)

func (*Step) UnmarshalYAML

func (s *Step) UnmarshalYAML(value *yaml.Node) error

type StepInputs

type StepInputs map[string]interface{}

Inputs is a map of step input names to structured values.

type StepOutputs

type StepOutputs map[string]interface{}

Outputs are the output values for a sequence. They can reference the outputs of sub-steps.

Jump to

Keyboard shortcuts

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