fix: labels from config.yml take precedence
Fixes: https://code.forgejo.org/forgejo/runner/issues/174
This commit is contained in:
parent
8a2d4cb7cb
commit
43a8a402f4
3 changed files with 6 additions and 7 deletions
|
@ -22,7 +22,7 @@ type Registration struct {
|
|||
Labels []string `json:"labels"`
|
||||
}
|
||||
|
||||
func LoadRegistration(file string) (*Registration, error) {
|
||||
func LoadRegistration(file string, labels []string) (*Registration, error) {
|
||||
f, err := os.Open(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -34,6 +34,9 @@ func LoadRegistration(file string) (*Registration, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if len(labels) > 0 {
|
||||
reg.Labels = labels
|
||||
}
|
||||
reg.Warning = ""
|
||||
|
||||
return ®, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue