mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	fix: split and trim labels
This commit is contained in:
		@@ -130,7 +130,7 @@ func RunnerDetailsEditPost(ctx *context.Context, runnerID, ownerID, repoID int64
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	form := web.GetForm(ctx).(*forms.EditRunnerForm)
 | 
						form := web.GetForm(ctx).(*forms.EditRunnerForm)
 | 
				
			||||||
	runner.Description = form.Description
 | 
						runner.Description = form.Description
 | 
				
			||||||
	runner.CustomLabels = strings.Split(form.CustomLabels, ",")
 | 
						runner.CustomLabels = splitLabels(form.CustomLabels)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = actions_model.UpdateRunner(ctx, runner, "description", "custom_labels")
 | 
						err = actions_model.UpdateRunner(ctx, runner, "description", "custom_labels")
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
@@ -182,3 +182,11 @@ func RunnerDeletePost(ctx *context.Context, runnerID int64,
 | 
				
			|||||||
	ctx.Flash.Success(ctx.Tr("runners.delete_runner_success"))
 | 
						ctx.Flash.Success(ctx.Tr("runners.delete_runner_success"))
 | 
				
			||||||
	ctx.Redirect(successRedirectTo)
 | 
						ctx.Redirect(successRedirectTo)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func splitLabels(s string) []string {
 | 
				
			||||||
 | 
						labels := strings.Split(s, ",")
 | 
				
			||||||
 | 
						for i, v := range labels {
 | 
				
			||||||
 | 
							labels[i] = strings.TrimSpace(v)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return labels
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user