labeler

package
v0.0.0-...-fe01ad3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed enrolled_teams.yml
	EnrolledTeamsYaml []byte
)

Functions

func ComputeLabels

func ComputeLabels(resources []string, regexpLabels []RegexpLabel) []string

func ExtractAffectedResources

func ExtractAffectedResources(body string) []string

func UpdateIssues

func UpdateIssues(repository string, issueUpdates []IssueUpdate, dryRun bool)

Types

type ErrorResponse

type ErrorResponse struct {
	Message string
}

type Issue

type Issue struct {
	Number      uint64
	Body        string
	Labels      []Label
	PullRequest map[string]any `json:"pull_request"`
}

func GetIssues

func GetIssues(repository, since string) []Issue

type IssueUpdate

type IssueUpdate struct {
	Number    uint64
	Labels    []string
	OldLabels []string
}

func ComputeIssueUpdates

func ComputeIssueUpdates(issues []Issue, regexpLabels []RegexpLabel) []IssueUpdate

type IssueUpdateBody

type IssueUpdateBody struct {
	Labels []string `json:"labels"`
}

type Label

type Label struct {
	Name string
}

type LabelData

type LabelData struct {
	Team      string   `yaml:"team,omitempty"`
	Resources []string `yaml:"resources"`
}

type RegexpLabel

type RegexpLabel struct {
	Regexp *regexp.Regexp
	Label  string
}

func BuildRegexLabels

func BuildRegexLabels(teamsYaml []byte) ([]RegexpLabel, error)

Jump to

Keyboard shortcuts

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