labeler

package
v0.0.0-...-def01c7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0, MPL-2.0 Imports: 13 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 EnsureLabelsWithColor

func EnsureLabelsWithColor(repository string, labelNames []string, color string) error

EnsureLabelsWithColor applies the computed changes using the GitHub API

func ExtractAffectedResources

func ExtractAffectedResources(body string) []string

func GetIssues

func GetIssues(repository, since string) ([]*github.Issue, error)

func UpdateIssues

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

Types

type IssueUpdate

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

func ComputeIssueUpdates

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

ComputeIssueUpdates remains the same as it doesn't interact with GitHub API

type Label

type Label struct {
	Name string
}

type LabelChange

type LabelChange struct {
	Name        string
	Color       string
	IsNew       bool
	NeedsUpdate bool
}

func ComputeLabelChanges

func ComputeLabelChanges(existingLabels []*github.Label, desiredLabels []string, desiredColor string) []LabelChange

ComputeLabelChanges determines which labels need to be created or updated

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