mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-09 12:49:12 +00:00
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:
24
tests/cmd/github-labels/utils.go
Normal file
24
tests/cmd/github-labels/utils.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user