schema

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(t *Task) error

Types

type Task

type Task struct {
	// List of actions that modify a repository.
	Actions []TaskActionsElem `json:"actions,omitempty" yaml:"actions,omitempty" mapstructure:"actions,omitempty"`

	// A list of usernames to set as assignees of a pull request.
	Assignees []string `json:"assignees,omitempty" yaml:"assignees,omitempty" mapstructure:"assignees,omitempty"`

	// Merge a pull request automatically if all have checks have passed and all
	// approvals have been given.
	AutoMerge bool `json:"autoMerge,omitempty" yaml:"autoMerge,omitempty" mapstructure:"autoMerge,omitempty"`

	// If set, automatically merge the pull request after it has been open for the
	// specified amount of time. Only applied if `autoMerge` is `true`. The value is a
	// Go duration, like 5m or 1h.
	AutoMergeAfter string `json:"autoMergeAfter,omitempty" yaml:"autoMergeAfter,omitempty" mapstructure:"autoMergeAfter,omitempty"`

	// If set, used as th name of the branch to commit changes to. Defaults to an
	// auto-generated name if not set.
	BranchName string `json:"branchName,omitempty" yaml:"branchName,omitempty" mapstructure:"branchName,omitempty"`

	// Number of pull requests to create in one run. Useful to reduce strain on a
	// system caused by, for example, many CI/CD jobs created at the same time.
	ChangeLimit int `json:"changeLimit,omitempty" yaml:"changeLimit,omitempty" mapstructure:"changeLimit,omitempty"`

	// If set, used as the message when changes get committed. Defaults to an
	// auto-generated message if not set.
	CommitMessage string `json:"commitMessage,omitempty" yaml:"commitMessage,omitempty" mapstructure:"commitMessage,omitempty"`

	// Create pull requests only. Don't attempt to update a pull request on a
	// subsequent run.
	CreateOnly bool `json:"createOnly,omitempty" yaml:"createOnly,omitempty" mapstructure:"createOnly,omitempty"`

	// Disable the task temporarily.
	Disabled *bool `json:"disabled,omitempty" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"`

	// Filters allow targeting a specific repositories.
	Filters []TaskFiltersElem `json:"filters,omitempty" yaml:"filters,omitempty" mapstructure:"filters,omitempty"`

	// If `true`, keep the branch after a pull request has been merged.
	KeepBranchAfterMerge bool `json:"keepBranchAfterMerge,omitempty" yaml:"keepBranchAfterMerge,omitempty" mapstructure:"keepBranchAfterMerge,omitempty"`

	// List of labels to attach to a pull request.
	Labels []string `json:"labels,omitempty" yaml:"labels,omitempty" mapstructure:"labels,omitempty"`

	// If `true`, no new pull request is being created if a previous pull request has
	// been merged for this task.
	MergeOnce bool `json:"mergeOnce,omitempty" yaml:"mergeOnce,omitempty" mapstructure:"mergeOnce,omitempty"`

	// The name of the task. Used as an identifier.
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// Plugins corresponds to the JSON schema field "plugins".
	Plugins []TaskPluginsElem `json:"plugins,omitempty" yaml:"plugins,omitempty" mapstructure:"plugins,omitempty"`

	// If set, used as the body of the pull request.
	PrBody string `json:"prBody,omitempty" yaml:"prBody,omitempty" mapstructure:"prBody,omitempty"`

	// If set, used as the title of the pull request.
	PrTitle string `json:"prTitle,omitempty" yaml:"prTitle,omitempty" mapstructure:"prTitle,omitempty"`
}

func (*Task) UnmarshalJSON

func (j *Task) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Task) UnmarshalYAML

func (j *Task) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type TaskActionsElem

type TaskActionsElem struct {
	// Identifier of the action.
	Action string `json:"action" yaml:"action" mapstructure:"action"`

	// Key/value pairs passed as parameters to the action.
	Params TaskActionsElemParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`
}

func (*TaskActionsElem) UnmarshalJSON

func (j *TaskActionsElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*TaskActionsElem) UnmarshalYAML

func (j *TaskActionsElem) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type TaskActionsElemParams

type TaskActionsElemParams map[string]string

Key/value pairs passed as parameters to the action.

type TaskFiltersElem

type TaskFiltersElem struct {
	// Identifier of the filter.
	Filter string `json:"filter" yaml:"filter" mapstructure:"filter"`

	// Key/value pairs passed as parameters to the filter.
	Params TaskFiltersElemParams `json:"params,omitempty" yaml:"params,omitempty" mapstructure:"params,omitempty"`

	// Reverse the result of the filter, i.e. negate it.
	Reverse bool `json:"reverse,omitempty" yaml:"reverse,omitempty" mapstructure:"reverse,omitempty"`
}

func (*TaskFiltersElem) UnmarshalJSON

func (j *TaskFiltersElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*TaskFiltersElem) UnmarshalYAML

func (j *TaskFiltersElem) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type TaskFiltersElemParams

type TaskFiltersElemParams map[string]string

Key/value pairs passed as parameters to the filter.

type TaskPluginsElem

type TaskPluginsElem struct {
	// Key/value pairs that hold additional configuration for the plugin. Sent to the
	// plugin once on startup.
	Configuration TaskPluginsElemConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty" mapstructure:"configuration,omitempty"`

	// Path corresponds to the JSON schema field "path".
	Path string `json:"path" yaml:"path" mapstructure:"path"`
}

func (*TaskPluginsElem) UnmarshalJSON

func (j *TaskPluginsElem) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*TaskPluginsElem) UnmarshalYAML

func (j *TaskPluginsElem) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type TaskPluginsElemConfiguration

type TaskPluginsElemConfiguration map[string]string

Key/value pairs that hold additional configuration for the plugin. Sent to the plugin once on startup.

Jump to

Keyboard shortcuts

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