Documentation
¶
Index ¶
- type Condition
- func AuthorCanMergeCondition() Condition
- func AuthorCondition() Condition
- func BaseBranchCondition() Condition
- func BodyCondition() Condition
- func BranchCondition() Condition
- func FilesCondition(l *Labeler) Condition
- func IsDraftCondition() Condition
- func IsMergeableCondition() Condition
- func SizeCondition() Condition
- func TitleCondition() Condition
- type DefaultHttpClient
- type HttpClient
- type LabelMatcher
- type LabelUpdates
- type Labeler
- type LabelerConfigV0
- type LabelerConfigV1
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
CanEvaluate func(target *Target) bool
Evaluate func(target *Target, matcher LabelMatcher) (bool, error)
GetName func() string
}
func AuthorCanMergeCondition ¶
func AuthorCanMergeCondition() Condition
func AuthorCondition ¶
func AuthorCondition() Condition
func BaseBranchCondition ¶
func BaseBranchCondition() Condition
func BodyCondition ¶
func BodyCondition() Condition
func BranchCondition ¶
func BranchCondition() Condition
func FilesCondition ¶
func IsDraftCondition ¶
func IsDraftCondition() Condition
func IsMergeableCondition ¶
func IsMergeableCondition() Condition
func SizeCondition ¶
func SizeCondition() Condition
func TitleCondition ¶
func TitleCondition() Condition
type DefaultHttpClient ¶
type DefaultHttpClient struct {
// contains filtered or unexported fields
}
type HttpClient ¶
func NewDefaultHttpClient ¶
func NewDefaultHttpClient() HttpClient
type LabelMatcher ¶
type LabelMatcher struct {
AuthorCanMerge string `yaml:"author-can-merge"`
Authors []string
BaseBranch string `yaml:"base-branch"`
Body string
Branch string
Draft string
Files []string
Label string
Mergeable string
Negate bool
SizeAbove string `yaml:"size-above"`
SizeBelow string `yaml:"size-below"`
Title string
}
type LabelUpdates ¶
type LabelUpdates struct {
// contains filtered or unexported fields
}
LabelUpdates Represents a request to update the set of labels
type Labeler ¶
type Labeler struct {
FetchRepoConfig func() (*LabelerConfigV1, error)
ReplaceLabels func(target *Target, labels []string) error
GetCurrentLabels func(target *Target) ([]string, error)
GitHub *gh.Client
Client HttpClient
}
func (*Labeler) HandleEvent ¶
HandleEvent takes a GitHub Event and its raw payload (see link below) to trigger an update to the issue / PR's labels.
func (*Labeler) ProcessAllIssues ¶
func (*Labeler) ProcessAllPRs ¶
type LabelerConfigV0 ¶
type LabelerConfigV0 map[string]LabelMatcher
type LabelerConfigV1 ¶
type LabelerConfigV1 struct {
Version int32
// When set to true, scheduled executions will process both PRs and
// issues. Else, we will only process PRs. Defaults to "False"
Issues bool
// When set to true, we will only add labels when they match a rule
// but it will NOT remove labels that were previously set and stop
// matching a rule
AppendOnly bool
Labels []LabelMatcher
}
Click to show internal directories.
Click to hide internal directories.