(ctx context.Context, param params.InstallWebhookParams)
| 2269 | } |
| 2270 | |
| 2271 | func (r *basePoolManager) InstallWebhook(ctx context.Context, param params.InstallWebhookParams) (params.HookInfo, error) { |
| 2272 | if r.controllerInfo.ControllerWebhookURL == "" { |
| 2273 | return params.HookInfo{}, runnerErrors.NewBadRequestError("controller webhook url is empty") |
| 2274 | } |
| 2275 | |
| 2276 | insecureSSL := "0" |
| 2277 | if param.InsecureSSL { |
| 2278 | insecureSSL = "1" |
| 2279 | } |
| 2280 | req := &github.Hook{ |
| 2281 | Active: github.Ptr(true), |
| 2282 | Config: &github.HookConfig{ |
| 2283 | ContentType: github.Ptr("json"), |
| 2284 | InsecureSSL: github.Ptr(insecureSSL), |
| 2285 | URL: github.Ptr(r.controllerInfo.ControllerWebhookURL), |
| 2286 | Secret: github.Ptr(r.WebhookSecret()), |
| 2287 | }, |
| 2288 | Events: []string{ |
| 2289 | "workflow_job", |
| 2290 | }, |
| 2291 | } |
| 2292 | |
| 2293 | return r.InstallHook(ctx, req) |
| 2294 | } |
| 2295 | |
| 2296 | func (r *basePoolManager) ValidateOwner(job params.WorkflowJob) error { |
| 2297 | switch r.entity.EntityType { |
nothing calls this directly
no test coverage detected