File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -292,12 +292,16 @@ let generate_status_notification (cfg : Config_t.config) (notification : status_
292
292
let branches_info =
293
293
match List. map ~f: (fun { name } -> name) notification.branches with
294
294
| [] -> [] (* happens when branch is force-pushed by the time CI notification arrives *)
295
- | branches ->
296
- match cfg.main_branch_name with
297
- | Some main when List. mem branches main ~equal: String. equal ->
298
- (* happens when new branches are branched before CI finishes *)
299
- [ sprintf " *Branch*: %s" main ]
300
- | _ -> [ sprintf " *Branches*: %s" (String. concat ~sep: " , " branches) ]
295
+ | notification_branches ->
296
+ let branches =
297
+ match cfg.main_branch_name with
298
+ | Some main when List. mem notification_branches main ~equal: String. equal ->
299
+ (* happens when new branches are branched before CI finishes *)
300
+ [ main ]
301
+ | _ -> notification_branches
302
+ in
303
+ let pluralize s = if Int. equal (List. length branches) 1 then s else sprintf " %ses" s in
304
+ [ sprintf " *%s*: %s" (pluralize " Branch" ) (String. concat ~sep: " , " branches) ]
301
305
in
302
306
let summary =
303
307
match target_url with
Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ will notify #default
477
477
"fields": [
478
478
{
479
479
"value":
480
- "*Commit*: `<https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478|0d95302a>` Update README.md - Khady\n*Branches *: master"
480
+ "*Commit*: `<https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478|0d95302a>` Update README.md - Khady\n*Branch *: master"
481
481
}
482
482
]
483
483
}
@@ -543,7 +543,7 @@ will notify #default
543
543
"fields": [
544
544
{
545
545
"value":
546
- "*Commit*: `<https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478|0d95302a>` Update README.md - Khady\n*Branches *: master"
546
+ "*Commit*: `<https://github.com/ahrefs/monorepo/commit/0d95302addd66c1816bce1b1d495ed1c93ccd478|0d95302a>` Update README.md - Khady\n*Branch *: master"
547
547
}
548
548
]
549
549
}
You can’t perform that action at this time.
0 commit comments