label

package
v0.0.0-...-0f89c28 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// regular expression to add label
	RegAddLabel = regexp.MustCompile(`(?mi)^/(kind|priority)\s*(.*)$`)
	// regular expression to remove label
	RegRemoveLabel = regexp.MustCompile(`(?mi)^/remove-(kind|priority)\s*(.*)$`)
)

Functions

func Add

func Add(client *github.Client, event github.IssueCommentEvent) error

add labels

func AddLabelsToPR

func AddLabelsToPR(ctx context.Context, prEvent github.PullRequestEvent, client *github.Client, addLable string) error

AddLabelsToPR function to add label to the PR

func GetLabelsMap

func GetLabelsMap(comment string) map[string]string

getLabelsMap for add or remove labels

func GetListOfAddLabels

func GetListOfAddLabels(mapOfAddLabels map[string]string, listofRepoLabels []*github.Label, listofIssueLabels []*github.Label) []string

getListOfAddLabels return the exact list of add labels

func GetListOfRemoveLabels

func GetListOfRemoveLabels(mapOfRemoveLabels map[string]string, listofIssueLabels []*github.Label) []string

getListOfRemoveLabels return the exact list of remove labels

func Handle

func Handle(client *github.Client, event github.IssueCommentEvent) error

Handle event with label

func HandlePRLabels

func HandlePRLabels(ctx context.Context, prEvent github.PullRequestEvent, client *github.Client) error

HandlePRLabels function to handle add or remove label to the PR

func Remove

func Remove(client *github.Client, event github.IssueCommentEvent) error

remove labels

func RemoveLabelsToPR

func RemoveLabelsToPR(ctx context.Context, prEvent github.PullRequestEvent, client *github.Client, addLable string) error

RemoveLabelsToPR function to remove label to the PR

Types

This section is empty.

Jump to

Keyboard shortcuts

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