action

package
v0.81.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrongConfig is returned when an action has missing mandatory attributes.
	ErrWrongConfig = errors.New("wrong action configuration")
)

Functions

This section is empty.

Types

type Action

type Action struct {
	Title   string
	Config  Config
	Scm     *scm.Scm
	Handler ActionHandler
	Report  reports.Action
}

Action is a struct used by an updatecli pipeline.

func New

func New(config *Config, sourceControlManager *scm.Scm) (Action, error)

New returns a new Action based on an action config and an scm

func (*Action) Update

func (a *Action) Update() error

Update updates an action object based on its configuration

type ActionHandler

type ActionHandler interface {
	CreateAction(report reports.Action, resetDescription bool) error
	CleanAction(report reports.Action) error
}

ActionHandler interface defines required functions to be an action

type Config

type Config struct {
	// Title defines the action title
	Title string `yaml:",omitempty"`
	// Kind defines the action `kind` which affects accepted "spec" values
	Kind string `yaml:",omitempty"`
	// Spec defines parameters for a specific "kind"
	Spec interface{} `yaml:",omitempty"`
	// scmid references a scm configuration defined within the updatecli manifest
	ScmID string `yaml:",omitempty"`
	// !Deprecated in favor of `scmid`
	DeprecatedScmID string `yaml:"scmID,omitempty" jsonschema:"-"`
	/*
		pipelineurl defines if a link to the Updatecli pipeline CI job should be added to the report.

		remarks:
		* Only available for GitHub Action, GitLab, Jenkins
	*/
	DisablePipelineURL bool `yaml:",omitempty"`
}

Config define action provided via an updatecli configuration

func (Config) JSONSchema

func (Config) JSONSchema() *jschema.Schema

JSONSchema implements the json schema interface to generate the "action" jsonschema

func (*Config) Validate

func (c *Config) Validate() (err error)

Validate ensures that an action configuration has required parameters.

Jump to

Keyboard shortcuts

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