diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 98c6457e4..d22d44ced 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -124,6 +124,12 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { uuid := form.Attachment jobType := form.JobType codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath + + if jobType != string(models.JobTypeBenchmark) && jobType != string(models.JobTypeDebug) { + log.Error("jobtype error:", jobType) + ctx.RenderWithErr("jobtype error", tplCloudBrainNew, &form) + return + } repo := ctx.Repo.Repository downloadCode(repo, codePath)