github

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OKToTestCommentRegexp = `(^|\n)\/ok-to-test(\r\n|\r|\n|$)`
)

Variables

View Source
var ErrInvalidContentType = errors.New("form parameter encoding not supported, please change the hook to send JSON payloads")

ErrInvalidContentType is returned when the content-type is not a JSON body.

Functions

func MatchRegexp added in v0.23.0

func MatchRegexp(reg, comment string) bool

Types

type AddChangedFiles added in v0.25.0

type AddChangedFiles struct {
	Enabled             bool                  `json:"enabled,omitempty"`
	PersonalAccessToken *triggersv1.SecretRef `json:"personalAccessToken,omitempty"`
}

type CheckType added in v0.25.0

type CheckType string
const (
	// Set the checkType to orgMembers to allow org members to submit or comment on PR to proceed
	OrgMembers CheckType = "orgMembers"
	// Set the checkType to repoMembers to allow repo members to submit or comment on PR to proceed
	RepoMembers CheckType = "repoMembers"
	// Set the checkType to all if both repo members or org members can submit or comment on PR to proceed
	All CheckType = "all"
	// Set the checkType to none if neither of repo members or org members can not submit or comment on PR to proceed
	None CheckType = "none"
)

type InterceptorImpl added in v0.25.0

type InterceptorImpl struct {
	SecretGetter interceptors.SecretGetter
}

func (*InterceptorImpl) Process added in v0.25.0

type InterceptorParams added in v0.25.0

type InterceptorParams struct {
	SecretRef *triggersv1.SecretRef `json:"secretRef,omitempty"`
	// +listType=atomic
	EventTypes      []string        `json:"eventTypes,omitempty"`
	AddChangedFiles AddChangedFiles `json:"addChangedFiles,omitempty"`
	GithubOwners    Owners          `json:"githubOwners,omitempty"`
}

InterceptorParams provides a webhook to intercept and pre-process events

type Owners added in v0.25.0

type Owners struct {
	Enabled bool `json:"enabled,omitempty"`
	// This param/variable is required for private repos or when checkType is set to orgMembers or repoMembers or all
	PersonalAccessToken *triggersv1.SecretRef `json:"personalAccessToken,omitempty"`
	// Set the value to one of the supported values (orgMembers, repoMembers, both, none)
	CheckType CheckType `json:"checkType,omitempty"`
}

type OwnersConfig added in v0.23.0

type OwnersConfig struct {
	Approvers []string `json:"approvers,omitempty"`
	Reviewers []string `json:"reviewers,omitempty"`
}

type OwnersPayloadDetails added in v0.23.0

type OwnersPayloadDetails struct {
	PrNumber         int
	Sender           string
	Owner            string
	Repository       string
	IssueCommentBody string
}

Jump to

Keyboard shortcuts

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