configcmd

package
v1.0.48165 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package configcmd contains the business logic for circleci config subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalPipelineValues

func LocalPipelineValues(params map[string]any) map[string]any

LocalPipelineValues fabricates the CircleCI pipeline values used when validating or processing a config locally. Git state is read best-effort; failures are silent. params are merged as pipeline.parameters.<key> and also returned separately so callers can pass them as PipelineParameters.

func ParsePipelineParams

func ParsePipelineParams(input string) (map[string]any, error)

ParsePipelineParams parses pipeline parameters from either a YAML/JSON string or a file path. A file is tried first; only when the path does not exist is the value parsed as inline YAML. An empty input yields a nil map and no error.

Types

type ValidateResult

type ValidateResult struct {
	Valid        bool     `json:"valid"`
	CompiledYAML string   `json:"compiled_yaml,omitempty"`
	Errors       []string `json:"errors,omitempty"`
}

ValidateResult holds the outcome of a config validation call.

func Process

func Process(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool, params map[string]any) (*ValidateResult, error)

Process compiles the config YAML and returns the fully expanded output YAML. params are pipeline parameters injected at << pipeline.parameters.* >>.

func Validate

func Validate(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool) (*ValidateResult, error)

Validate compiles the config YAML against the CircleCI API and returns whether it is valid. orgID may be empty; pass one to enable private orb resolution.

Jump to

Keyboard shortcuts

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