yaml

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concurrency

type Concurrency struct {
	Group            string `yaml:"group,omitempty"`
	CancelInProgress bool   `yaml:"cancel-in-progress,omitempty"`
}

func (*Concurrency) UnmarshalYAML

func (v *Concurrency) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Container

type Container struct {
	Image       string            `yaml:"image,omitempty"`
	Env         map[string]string `yaml:"env,omitempty"`
	Ports       []string          `yaml:"ports,omitempty"`
	Volumes     []string          `yaml:"volumes,omitempty"`
	Options     string            `yaml:"options,omitempty"`
	Credentials *Credentials      `yaml:"credentials,omitempty"`
}

func (*Container) UnmarshalYAML

func (v *Container) UnmarshalYAML(unmarshal func(interface{}) error) error

type Credentials

type Credentials struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type Defaults

type Defaults struct {
	Run *Run `yaml:"run,omitempty"`
}

type Environment

type Environment struct {
	Name string `yaml:"name"`
	URL  string `yaml:"url,omitempty"`
}

func (*Environment) UnmarshalYAML

func (v *Environment) UnmarshalYAML(unmarshal func(interface{}) error) error

type Event

type Event struct {
	Types []string `yaml:"types,omitempty"`
}

type Input

type Input struct {
	Default     interface{} `yaml:"default,omitempty"`
	Description string      `yaml:"description,omitempty"`
	Options     interface{} `yaml:"options,omitempty"`
	Required    bool        `yaml:"required,omitempty"`
	Type        string      `yaml:"type,omitempty"`
}

type Job

type Job struct {
	Concurrency   *Concurrency        `yaml:"concurrency,omitempty"`
	Container     *Container          `yaml:"container,omitempty"`
	ContinueOnErr bool                `yaml:"continue-on-error,omitempty"` // TODO string instead of bool? `continue-on-error: ${{ matrix.experimental }}`
	Defaults      *Defaults           `yaml:"defaults,omitempty"`
	Env           map[string]string   `yaml:"env,omitempty"`
	Environment   *Environment        `yaml:"environment,omitempty"`
	If            string              `yaml:"if,omitempty"`
	Name          string              `yaml:"name,omitempty"`
	Needs         Stringorslice       `yaml:"needs,omitempty"`
	Outputs       map[string]string   `yaml:"outputs,omitempty"`
	Permissions   *Permissions        `yaml:"permissions,omitempty"`
	RunsOn        string              `yaml:"runs-on,omitempty"`
	Secrets       *Secrets            `yaml:"secrets,omitempty"`
	Services      map[string]*Service `yaml:"services,omitempty"`
	Steps         []*Step             `yaml:"steps,omitempty"`
	Strategy      *Strategy           `yaml:"strategy,omitempty"`
	TimeoutMin    int                 `yaml:"timeout-minutes,omitempty"`
	Uses          string              `yaml:"uses,omitempty"`
	With          map[string]string   `yaml:"with,omitempty"`
}

type Matrix

type Matrix struct {
	Exclude []map[string]interface{} `yaml:"exclude,omitempty"`
	Include []map[string]interface{} `yaml:"include,omitempty"`
	Matrix  map[string][]string      `yaml:",inline"`
}

type On

type On struct {
	BranchProtectionRule     *Event             `yaml:"branch_protection_rule,omitempty"`
	CheckRun                 *Event             `yaml:"check_run,omitempty"`
	CheckSuite               *Event             `yaml:"check_suite,omitempty"`
	Create                   *struct{}          `yaml:"create,omitempty"`
	Delete                   *struct{}          `yaml:"delete,omitempty"`
	Deployment               *struct{}          `yaml:"deployment,omitempty"`
	DeploymentStatus         *struct{}          `yaml:"deployment_status,omitempty"`
	Discussion               *Event             `yaml:"discussion,omitempty"`
	DiscussionComment        *Event             `yaml:"discussion_comment,omitempty"`
	Fork                     *struct{}          `yaml:"fork,omitempty"`
	Gollum                   *struct{}          `yaml:"gollum,omitempty"`
	IssueComment             *Event             `yaml:"issue_comment,omitempty"`
	Issues                   *Event             `yaml:"issues,omitempty"`
	Label                    *Event             `yaml:"label,omitempty"`
	Member                   *Event             `yaml:"member,omitempty"`
	MergeGroup               *Event             `yaml:"merge_group,omitempty"`
	Milestone                *Event             `yaml:"milestone,omitempty"`
	PageBuild                *struct{}          `yaml:"page_build,omitempty"`
	Project                  *Event             `yaml:"project,omitempty"`
	ProjectCard              *Event             `yaml:"project_card,omitempty"`
	ProjectColumn            *Event             `yaml:"project_column,omitempty"`
	Public                   *struct{}          `yaml:"public,omitempty"`
	PullRequest              *PullRequest       `yaml:"pull_request,omitempty"`
	PullRequestReview        *Event             `yaml:"pull_request_review,omitempty"`
	PullRequestReviewComment *Event             `yaml:"pull_request_review_comment,omitempty"`
	PullRequestTarget        *PullRequestTarget `yaml:"pull_request_target,omitempty"`
	Push                     *Push              `yaml:"push,omitempty"`
	RegistryPackage          *Event             `yaml:"registry_package,omitempty"`
	RepositoryDispatch       *Event             `yaml:"repository_dispatch,omitempty"`
	Release                  *Event             `yaml:"release,omitempty"`
	Schedule                 *Schedule          `yaml:"schedule,omitempty"`
	Status                   *struct{}          `yaml:"status,omitempty"`
	Watch                    *Event             `yaml:"watch,omitempty"`
	WorkflowCall             *WorkflowCall      `yaml:"workflow_call,omitempty"`
	WorkflowDispatch         *WorkflowDispatch  `yaml:"workflow_dispatch,omitempty"`
	WorkflowRun              *WorkflowRun       `yaml:"workflow_run,omitempty"`
}

func (*On) UnmarshalYAML

func (v *On) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface for WorkflowTriggers.

type Permissions

type Permissions struct {
	Actions            string `yaml:"actions,omitempty"`
	Checks             string `yaml:"checks,omitempty"`
	Contents           string `yaml:"contents,omitempty"`
	Deployments        string `yaml:"deployments,omitempty"`
	IDToken            string `yaml:"id-token,omitempty"`
	Issues             string `yaml:"issues,omitempty"`
	Discussions        string `yaml:"discussions,omitempty"`
	Packages           string `yaml:"packages,omitempty"`
	Pages              string `yaml:"pages,omitempty"`
	PullRequests       string `yaml:"pull-requests,omitempty"`
	RepositoryProjects string `yaml:"repository-projects,omitempty"`
	SecurityEvents     string `yaml:"security-events,omitempty"`
	Statuses           string `yaml:"statuses,omitempty"`
	ReadAll            bool   `yaml:"-"`
	WriteAll           bool   `yaml:"-"`
}

func (*Permissions) MarshalYAML

func (v *Permissions) MarshalYAML() (interface{}, error)

MarshalYAML implements the marshal interface.

func (*Permissions) UnmarshalYAML

func (v *Permissions) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface for WorkflowTriggers.

type Pipeline

type Pipeline struct {
	Concurrency *Concurrency      `yaml:"concurrency,omitempty"`
	Defaults    *Defaults         `yaml:"defaults,omitempty"`
	Env         map[string]string `yaml:"env,omitempty"`
	Jobs        map[string]*Job   `yaml:"jobs,omitempty"`
	Name        string            `yaml:"name,omitempty"`
	On          *On               `yaml:"on,omitempty"`
	Permissions *Permissions      `yaml:"permissions,omitempty"`
	RunName     string            `yaml:"run-name,omitempty"`
}

func Parse

func Parse(r io.Reader) (*Pipeline, error)

Parse parses the configuration from io.Reader r.

func ParseBytes

func ParseBytes(b []byte) (*Pipeline, error)

ParseBytes parses the configuration from bytes b.

func ParseFile

func ParseFile(p string) (*Pipeline, error)

ParseFile parses the configuration from path p.

func ParseString

func ParseString(s string) (*Pipeline, error)

ParseString parses the configuration from string s.

type PullRequest

type PullRequest struct {
	Branches        []string `yaml:"branches,omitempty"`
	BranchesIgnore  []string `yaml:"branches-ignore,omitempty"`
	Paths           []string `yaml:"paths,omitempty"`
	PathsIgnore     []string `yaml:"paths-ignore,omitempty"`
	Tags            []string `yaml:"tags,omitempty"`
	TagsIgnore      []string `yaml:"tags-ignore,omitempty"`
	Types           []string `yaml:"types,omitempty"`
	ReviewApproved  bool     `yaml:"review-approved,omitempty"`
	ReviewDismissed bool     `yaml:"review-dismissed,omitempty"`
}

type PullRequestTarget

type PullRequestTarget struct {
	Branches       []string `yaml:"branches,omitempty"`
	BranchesIgnore []string `yaml:"branches-ignore,omitempty"`
	Types          []string `yaml:"types,omitempty"`
}

type Push

type Push struct {
	Branches       []string `yaml:"branches,omitempty"`
	BranchesIgnore []string `yaml:"branches-ignore,omitempty"`
	Paths          []string `yaml:"paths,omitempty"`
	PathsIgnore    []string `yaml:"paths-ignore,omitempty"`
	Tags           []string `yaml:"tags,omitempty"`
	TagsIgnore     []string `yaml:"tags-ignore,omitempty"`
}

type Run

type Run struct {
	Shell      string `yaml:"shell,omitempty"`
	WorkingDir string `yaml:"working-directory,omitempty"`
}

type Schedule

type Schedule struct {
	Items []*ScheduleItem
}

func (*Schedule) MarshalYAML

func (v *Schedule) MarshalYAML() (interface{}, error)

MarshalYAML implements the marshal interface.

func (*Schedule) UnmarshalYAML

func (v *Schedule) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface for WorkflowTriggers.

type ScheduleItem

type ScheduleItem struct {
	Cron string `yaml:"cron,omitempty"`
}

type Secrets

type Secrets struct {
	Inherit bool
	Values  map[string]string
}

func (*Secrets) MarshalYAML

func (v *Secrets) MarshalYAML() (interface{}, error)

MarshalYAML implements the marshal interface.

func (*Secrets) UnmarshalYAML

func (v *Secrets) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Service

type Service struct {
	Env         map[string]string `yaml:"env,omitempty"`
	Image       string            `yaml:"image,omitempty"`
	Networks    []string          `yaml:"networks,omitempty"`
	Options     []string          `yaml:"options,omitempty"`
	Ports       []string          `yaml:"ports,omitempty"`
	Volumes     []string          `yaml:"volumes,omitempty"`
	Credentials *Credentials      `yaml:"credentials,omitempty"`
}

type Step

type Step struct {
	ContinueOnErr bool                   `yaml:"continue-on-error,omitempty"`
	Env           map[string]string      `yaml:"env,omitempty"`
	If            string                 `yaml:"if,omitempty"`
	Name          string                 `yaml:"name,omitempty"`
	Run           string                 `yaml:"run,omitempty"`
	Timeout       int                    `yaml:"timeout-minutes,omitempty"`
	With          map[string]interface{} `yaml:"with,omitempty"`
	Uses          string                 `yaml:"uses,omitempty"`
}

type Strategy

type Strategy struct {
	Matrix      *Matrix `yaml:"matrix,omitempty"`
	FailFast    bool    `yaml:"fail-fast,omitempty"`
	MaxParallel int     `yaml:"max-parallel,omitempty"`
}

type Stringorslice

type Stringorslice []string

Stringorslice represents a string or an array of strings.

func (*Stringorslice) UnmarshalYAML

func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type WorkflowCall

type WorkflowCall struct {
	Inputs    map[string]interface{}         `yaml:"inputs,omitempty"`
	Outputs   map[string]interface{}         `yaml:"outputs,omitempty"`
	Secrets   map[string]*WorkflowCallSecret `yaml:"secrets,omitempty"`
	Workflows []string                       `yaml:"workflows,omitempty"`
}

type WorkflowCallSecret

type WorkflowCallSecret struct {
	Description string `yaml:"description,omitempty"`
	Required    bool   `yaml:"required,omitempty"`
}

type WorkflowDispatch

type WorkflowDispatch struct {
	Inputs map[string]*Input `yaml:"inputs,omitempty"`
}

type WorkflowRun

type WorkflowRun struct {
	Branches       []string `yaml:"branches,omitempty"`
	BranchesIgnore []string `yaml:"branches-ignore,omitempty"`
	Types          []string `yaml:"types,omitempty"`
	Workflows      []string `yaml:"workflows,omitempty"`
}

Jump to

Keyboard shortcuts

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