action

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Path        string
	Raw         []byte
	DirName     string
	Name        string                   `yaml:"name"`
	Description string                   `yaml:"description"`
	Inputs      map[string]*ActionInput  `yaml:"inputs"`
	Outputs     map[string]*ActionOutput `yaml:"outputs"`
	Runs        *ActionRuns              `yaml:"runs"`
}

func (*Action) Init

func (a *Action) Init(fromRaw bool) error

func (*Action) Validate

func (a *Action) Validate(d IDotGithub) ([]string, error)

type ActionInput

type ActionInput struct {
	Description string `yaml:"description"`
	Default     string `yaml:"default"`
	Required    bool   `yaml:"required"`
}

func (*ActionInput) Validate

func (ai *ActionInput) Validate(action string, name string) ([]string, error)

type ActionOutput

type ActionOutput struct {
	Description string `yaml:"description"`
	Value       string `yaml:"value"`
}

func (*ActionOutput) Validate

func (ao *ActionOutput) Validate(action string, name string) ([]string, error)

type ActionRuns

type ActionRuns struct {
	Using string        `yaml:"using"`
	Steps []*ActionStep `yaml:"steps"`
}

func (*ActionRuns) IsStepExist

func (ar *ActionRuns) IsStepExist(id string) bool

func (*ActionRuns) IsStepOutputExist

func (ar *ActionRuns) IsStepOutputExist(step string, output string, d IDotGithub) int

func (*ActionRuns) SetParentType

func (ar *ActionRuns) SetParentType(t string)

func (*ActionRuns) Validate

func (ar *ActionRuns) Validate(dirName string, d IDotGithub) ([]string, error)

type ActionStep

type ActionStep struct {
	ParentType string
	Name       string            `yaml:"name"`
	Id         string            `yaml:"id"`
	Uses       string            `yaml:"uses"`
	Shell      string            `yaml:"bash"`
	Env        map[string]string `yaml:"env"`
	Run        string            `yaml:"run"`
	With       map[string]string `yaml:"with"`
}

func (*ActionStep) Validate

func (as *ActionStep) Validate(action string, workflowJob string, name string, d IDotGithub) ([]string, error)

type IDotGithub

type IDotGithub interface {
	GetAction(n string) *Action
	DownloadExternalAction(path string) error
	GetExternalAction(n string) *Action

	IsWorkflowJobStepOutputExist(action string, job string, step string, output string) bool
	IsEnvExistInWorkflowOrItsJob(action string, job string, env string) bool
}

Jump to

Keyboard shortcuts

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