action

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package action contains HCL configuration types and parsing logic for GitHub Actions step-level blocks: uses (action references), with (input parameters), and env (environment variables).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateUsesRef

func ValidateUsesRef(uses string) error

ValidateUsesRef checks that a step 'uses' value follows a valid format:

  • {owner}/{repo}@{ref}
  • {owner}/{repo}/{path}@{ref}
  • ./local/path
  • docker://{image}

Types

type EnvConfig

type EnvConfig struct {
	Name  hcl.Expression `hcl:"name,attr"`
	Value hcl.Expression `hcl:"value,attr"`
}

EnvConfig represents the HCL configuration for a single env block.

type EnvListConfig

type EnvListConfig []EnvConfig

EnvListConfig is a slice of EnvConfig decoded from HCL env blocks.

func (*EnvListConfig) Parse

func (config *EnvListConfig) Parse(hv *hclparser.HCLVars) (cty.Value, error)

Parse resolves env blocks into a cty object mapping names to values.

type Uses

type Uses struct {
	Action  cty.Value `yaml:"action,omitempty"`
	Version cty.Value `yaml:"version,omitempty"`
}

Uses holds the parsed action reference and optional version.

type UsesConfig

type UsesConfig struct {
	Action  hcl.Expression `hcl:"action,attr"`
	Version hcl.Expression `hcl:"version,attr"`
}

UsesConfig represents the HCL configuration for a uses block.

type UsesListConfig

type UsesListConfig []UsesConfig

UsesListConfig is a slice of UsesConfig decoded from HCL uses blocks.

func (*UsesListConfig) Parse

func (config *UsesListConfig) Parse(hv *hclparser.HCLVars) (cty.Value, error)

Parse resolves the uses block into a single "action@version" cty string value.

type WithConfig

type WithConfig struct {
	Name  hcl.Expression `hcl:"name,attr"`
	Value hcl.Expression `hcl:"value,attr"`
}

WithConfig represents the HCL configuration for a single with block.

type WithListConfig

type WithListConfig []WithConfig

WithListConfig is a slice of WithConfig decoded from HCL with blocks.

func (*WithListConfig) Parse

func (config *WithListConfig) Parse(hv *hclparser.HCLVars) (cty.Value, error)

Parse resolves with blocks into a cty object mapping names to values.

Jump to

Keyboard shortcuts

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