step

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package step contains the Step domain model and bidirectional serialization logic. StepConfig represents the HCL-side structure decoded via gohcl, while Step holds the normalized intermediate representation used for both HCL-to-YAML parsing and YAML-to-HCL unparsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Step

type Step struct {
	Identifier       string    `yaml:"-"`
	Id               cty.Value `yaml:"id,omitempty" hcl:"id"`
	If               cty.Value `yaml:"if,omitempty" hcl:"if"`
	Name             cty.Value `yaml:"name,omitempty" hcl:"name"`
	Uses             cty.Value `yaml:"uses,omitempty" hcl:"uses"`
	UsesComment      string    `yaml:"-"`
	Run              cty.Value `yaml:"run,omitempty" hcl:"run"`
	WorkingDirectory cty.Value `yaml:"working-directory,omitempty" hcl:"working_directory"`
	Shell            cty.Value `yaml:"shell,omitempty" hcl:"shell"`
	With             cty.Value `yaml:"with,omitempty" hcl:"with"`
	Env              cty.Value `yaml:"env,omitempty" hcl:"env"`
	ContinueOnError  cty.Value `yaml:"continue-on-error,omitempty" hcl:"continue_on_error"`
	TimeoutMinutes   cty.Value `yaml:"timeout-minutes,omitempty" hcl:"timeout_minutes"`
}

Step holds the parsed fields of a single GitHub Actions workflow step.

func (*Step) Decode

func (s *Step) Decode(body *hclwrite.Body, attr string) error

Decode writes the step as an HCL block into the given body.

func (*Step) PreDecode

func (s *Step) PreDecode(val cty.Value) error

PreDecode populates the step fields from a cty object value (YAML-to-HCL path).

func (*Step) Update

func (s *Step) Update(filename string)

Update sets the step's identifier to the given filename.

type StepConfig

type StepConfig struct {
	Identifier       string                `hcl:"id,label"`
	Id               hcl.Expression        `hcl:"id,attr"`
	IgnoreId         hcl.Expression        `hcl:"ignore_id,attr"`
	If               hcl.Expression        `hcl:"if,attr"`
	Name             hcl.Expression        `hcl:"name,attr"`
	Uses             action.UsesListConfig `hcl:"uses,block"`
	Run              hcl.Expression        `hcl:"run,attr"`
	WorkingDirectory hcl.Expression        `hcl:"working_directory,attr"`
	Shell            hcl.Expression        `hcl:"shell,attr"`
	With             action.WithListConfig `hcl:"with,block"`
	Env              action.EnvListConfig  `hcl:"env,block"`
	ContinueOnError  hcl.Expression        `hcl:"continue_on_error,attr"`
	TimeoutMinutes   hcl.Expression        `hcl:"timeout_minutes,attr"`
}

StepConfig represents the HCL configuration for a single step block.

func (*StepConfig) Parse

func (config *StepConfig) Parse(hv *hclparser.HCLVars) (Step, error)

Parse resolves the HCL step configuration into a Step using the provided variables.

type StepListConfig

type StepListConfig []StepConfig

StepListConfig is a slice of StepConfig decoded from HCL step blocks.

func (*StepListConfig) Parse

func (config *StepListConfig) Parse(hv *hclparser.HCLVars) (Steps, error)

Parse resolves all step configurations in the list into a Steps map.

type Steps

type Steps map[string]Step

Steps maps step identifiers to their parsed Step representations.

Jump to

Keyboard shortcuts

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