tests: move github-labels to main repo

Move tool as part of static checks migration.

Fixes #8187

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
Signed-off-by: Derek Lee <derlee@redhat.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Graham Whaley <graham.whaley@intel.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
Chelsea Mafrica
2023-11-21 17:48:18 -08:00
parent 7f3c12f1dd
commit 66f3944b52
22 changed files with 2642 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
// Copyright (c) 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package main
import "errors"
func getLabelsByCategory(categoryName string, lf *LabelsFile) ([]Label, error) {
var labels []Label
if categoryName == "" {
return nil, errors.New("need category name")
}
for _, label := range lf.Labels {
if label.CategoryName == categoryName {
labels = append(labels, label)
}
}
return labels, nil
}