Skip to content

Commit 6cd4abb

Browse files
committed
rename required_labels to requireLabel
Signed-off-by: Mauro Stettler <[email protected]>
1 parent 7234171 commit 6cd4abb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/labeler/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ type Config struct {
2727
// The label with the highest score is applied to the issue.
2828
Labels map[string]Label `yaml:"labels,omitempty"`
2929

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

3434
func (c *Config) Validate() error {

pkg/labeler/labeler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (l *Labeler) Run(issue *github.Issue) error {
4747
return nil
4848
}
4949

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

5252
if l.hasAssignableLabel(issue) {
5353
return nil
@@ -155,7 +155,7 @@ func (l *Labeler) hasAssignableLabel(issue *github.Issue) bool {
155155
func (l *Labeler) hasRequiredLabels(issue *github.Issue) bool {
156156
issueLabels := getIssueLabels(issue)
157157

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

0 commit comments

Comments
 (0)