File tree 1 file changed +21
-9
lines changed
1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -216,16 +216,28 @@ let hide_success (n : status_notification) (ctx : Context.t) =
216
216
let partition_status (ctx : Context.t ) (n : status_notification ) =
217
217
let cfg = ctx.cfg in
218
218
let get_commit_info () =
219
- match % lwt Github. generate_query_commmit cfg ~url: n.commit.url ~sha: n.commit.sha with
220
- | None -> Lwt. return @@ Option. to_list cfg.prefix_rules.default
221
- | Some commit ->
222
- match
223
- List. exists n.branches ~f: (fun { name } -> is_main_merge_message ~msg: commit.commit.message ~branch: name cfg)
224
- with
219
+ let default () = Lwt. return @@ Option. to_list cfg.prefix_rules.default in
220
+ match cfg.main_branch_name with
221
+ | None -> default ()
222
+ | Some main_branch_name ->
223
+ (* non-main branch build notifications go to default channel to reduce spam in topic channels *)
224
+ match List. exists n.branches ~f: (fun { name } -> String. equal name main_branch_name) with
225
+ | false -> default ()
225
226
| true ->
226
- log#info " main branch merge, ignoring status event %s: %s" n.context (first_line commit.commit.message);
227
- Lwt. return []
228
- | false -> Lwt. return (partition_commit cfg commit.files)
227
+ ( match % lwt Github. generate_query_commmit cfg ~url: n.commit.url ~sha: n.commit.sha with
228
+ | None -> default ()
229
+ | Some commit ->
230
+ (*
231
+ match
232
+ List.exists n.branches ~f:(fun { name } -> is_main_merge_message ~msg:commit.commit.message ~branch:name cfg)
233
+ with
234
+ | true ->
235
+ log#info "main branch merge, ignoring status event %s: %s" n.context (first_line commit.commit.message);
236
+ Lwt.return []
237
+ | false ->
238
+ *)
239
+ Lwt. return (partition_commit cfg commit.files)
240
+ )
229
241
in
230
242
let res =
231
243
match
You can’t perform that action at this time.
0 commit comments