// labelsActions manages all actions on labels.
labelsActions manages all actions on labels.
// labelsActions manages all actions on labels .
func (app *Application) labelsActions(repository models.Repository) {
	currentLabels := repository.GetAllLabels(app.Token)
	for _, labelToAdd := range app.Config.Labels {
		labelToAdd.Information.Repository = repository.Name
		if len(labelToAdd.Repositories) == 0 { 
			app.updateLabel(currentLabels, &labelToAdd)
		} else {
			for _, repositoyRegex := range labelToAdd.Repositories {
				if matched, err := regexp.MatchString(repositoyRegex, repository.Name); matched {
					app.updateLabel(currentLabels, &labelToAdd)
					break
				} else if err != nil {
					fmt.Printf("\tError matching regex %v : %v\n", repositoyRegex, err)
					continue
				}
				fmt.Printf("\tRepository %v not matching any regexp\n", repository.Name)
			}
		}
	}
}
func ( app * Application ) labelsActions ( repository models . Repository ) { currentLabels := repository . GetAllLabels ( app . Token ) for _ , labelToAdd := range app . Config . Labels { labelToAdd . Information . Repository = repository . Name if len ( labelToAdd . Repositories ) == 0 { app . updateLabel ( currentLabels , & labelToAdd ) } else { for _ , repositoyRegex := range labelToAdd . Repositories { if matched , err := regexp . MatchString ( repositoyRegex , repository . Name ) ; matched { app . updateLabel ( currentLabels , & labelToAdd ) break } else if err != nil { fmt . Printf ( " \t \n " , repositoyRegex , err ) continue } fmt . Printf ( " \t \n " , repository . Name ) } } } }
labelsActions manages all actions on labels.
labelsActions manages all actions on labels .
// No rule, accept all repo