File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -210,16 +210,22 @@ module Action (Github_api : Api.Github) (Slack_api : Api.Slack) = struct
210
210
211
211
let do_github_tasks ctx (req : Github.t ) =
212
212
let cfg = Context. get_config_exn ctx in
213
+ let project_owners (pull_request : pull_request ) repository number =
214
+ match Github. get_project_owners pull_request.labels cfg.project_owners with
215
+ | Some reviewers ->
216
+ ( match % lwt Github_api. request_reviewers ~ctx ~repo: repository ~number ~reviewers with
217
+ | Ok () -> Lwt. return_unit
218
+ | Error e -> action_error e
219
+ )
220
+ | None -> Lwt. return_unit
221
+ in
213
222
match req with
214
- | Github. Pull_request { action = Labeled ; pull_request; repository; number; _ } ->
223
+ | Github. Pull_request
224
+ { action; pull_request = { draft = false ; state = Open ; _ } as pull_request; repository; number; _ } ->
215
225
begin
216
- match Github. get_project_owners pull_request.labels cfg.project_owners with
217
- | Some reviewers ->
218
- ( match % lwt Github_api. request_reviewers ~ctx ~repo: repository ~number ~reviewers with
219
- | Ok () -> Lwt. return_unit
220
- | Error e -> action_error e
221
- )
222
- | None -> Lwt. return_unit
226
+ match action with
227
+ | Ready_for_review | Labeled -> project_owners pull_request repository number
228
+ | _ -> Lwt. return_unit
223
229
end
224
230
| _ -> Lwt. return_unit
225
231
You can’t perform that action at this time.
0 commit comments