action

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAssignees added in v1.3.0

func CheckAssignees(log *logrus.Logger, pull PullRequestAssignee) error

Check the title of the pull request to validate that it is at least the minimum length required, and return an error if it is not

func CheckBody added in v1.2.0

func CheckBody(log *logrus.Logger, pull PullRequestBody, split string, minimum int) error

Check the body of the pull request to validate that it is at least the minimum length required, and return an error if it is not

func CheckLabels

func CheckLabels(log *logrus.Logger, pull PullRequestLabels, prefixes []string, mode string) error

Check the labels of the pull request to validate that the prefixes requested have been attached, and return an error if it is not

func CheckTitle

func CheckTitle(log *logrus.Logger, pull PullRequestTitle, minimum int) error

Check the title of the pull request to validate that it is at least the minimum length required, and return an error if it is not

func RunAutomations added in v1.1.0

func RunAutomations(logger *logrus.Logger, pull *github.PullRequest) error

func RunChecks

func RunChecks(logger *logrus.Logger, pull PullRequest, options *Options) error

Types

type Options added in v1.1.0

type Options struct {
	TitleMinimum    int
	BodySplit       string
	BodyMinimum     int
	LabelPrefixes   string
	LabelPrefixMode string
	AutoAssign      bool
}

type PullRequest added in v1.2.0

type PullRequest interface {
	PullRequestTitle
	PullRequestLabels
	PullRequestBody
	PullRequestAssignee

	GetOwner() string
	GetRepository() string
	GetNumber() int
}

type PullRequestAssignee added in v1.3.0

type PullRequestAssignee interface {
	GetUser() *github.User
	GetAssignees() []*github.User
	SetAssignee([]string) error
}

Define an Interface which maps to the GetAssignee function on the type so that we can simplify the requirements of the value passed and improve testability

type PullRequestBody added in v1.2.0

type PullRequestBody interface {
	GetBody() string
}

Define an Interface which maps to the GetBody function on the type so that we can simplify the requirements of the value passed and improve testability

type PullRequestLabels added in v1.1.0

type PullRequestLabels interface {
	GetLabels() []*github.Label
}

Define an Interface which maps to the GetLabels function on the type so that we can simplify the requirements of the value passed and improve testability

type PullRequestTitle added in v1.1.0

type PullRequestTitle interface {
	GetTitle() string
}

Define an Interface which maps to the GetTitle function on the type so that we can simplify the requirements of the value passed and improve testability

Jump to

Keyboard shortcuts

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