validation

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package validation provides input validation and history-based suggestions for workflow inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDispatch added in v1.10.0

func ValidateDispatch(inputs map[string]workflow.Input, values map[string]string) map[string][]string

ValidateDispatch names what is wrong with a set of input values before the dispatch goes out, keyed by input name. A choice outside its options and a boolean that is not true or false are what GitHub rejects; a required input left blank is this tool's own rule, since a blank one is a mistake far more often than it is a value.

func ValidateEnvironment added in v1.10.0

func ValidateEnvironment(value string, environments []string) string

ValidateEnvironment names an environment input set to something the repository does not have. It is separate because the environments are read from the API rather than declared by the workflow, and an empty list means they could not be read rather than that none exist.

Types

type ConfigValidationError

type ConfigValidationError struct {
	HistoricalName  string
	HistoricalValue string
	Suggestion      string
	Status          Status
}

ConfigValidationError represents a validation error for a historical input.

func ValidateHistoryConfig

func ValidateHistoryConfig(entry *frecency.HistoryEntry, wf *workflow.File) []ConfigValidationError

ValidateHistoryConfig validates a historical configuration against current workflow inputs. Returns a list of validation errors, or nil if all inputs are valid.

type Status added in v1.0.1

type Status int

Status represents the validation state of a historical input.

const (
	StatusValid          Status = iota // Input is valid
	StatusMissing                      // Input name no longer exists
	StatusTypeChanged                  // Input type has changed
	StatusOptionsChanged               // Value not in choice options
)

Validation status values.

Jump to

Keyboard shortcuts

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