Skip to content

Commit

Permalink
rename required_labels to requireLabel
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Stettler <[email protected]>
  • Loading branch information
replay committed Aug 2, 2024
1 parent 7234171 commit 6cd4abb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/labeler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type Config struct {
// The label with the highest score is applied to the issue.
Labels map[string]Label `yaml:"labels,omitempty"`

// RequiredLabels is a list of labels that must be present on the issue for any other labels to be applied.
RequiredLabels []string `yaml:"required_labels,omitempty"`
// RequireLabel is a list of labels that must be present on the issue for any other labels to be applied.
RequireLabel []string `yaml:"requireLabel,omitempty"`
}

func (c *Config) Validate() error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/labeler/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (l *Labeler) Run(issue *github.Issue) error {
return nil
}

level.Info(l.logger).Log("msg", "issue has the required labels", "required_labels", strings.Join(l.cfg.RequiredLabels, ", "))
level.Info(l.logger).Log("msg", "issue has the required labels", "required_labels", strings.Join(l.cfg.RequireLabel, ", "))

if l.hasAssignableLabel(issue) {
return nil
Expand Down Expand Up @@ -155,7 +155,7 @@ func (l *Labeler) hasAssignableLabel(issue *github.Issue) bool {
func (l *Labeler) hasRequiredLabels(issue *github.Issue) bool {
issueLabels := getIssueLabels(issue)

for _, requiredLabel := range l.cfg.RequiredLabels {
for _, requiredLabel := range l.cfg.RequireLabel {
if !slices.Contains[[]string, string](issueLabels, requiredLabel) {
level.Info(l.logger).Log("msg", "issue is missing required label", "label", requiredLabel)
return false
Expand Down

0 comments on commit 6cd4abb

Please sign in to comment.