Skip to content

Commit fb01b81

Browse files
committed
slack messages: show file changes number even in root
1 parent 2a7f937 commit fb01b81

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/slack_message.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ let condense_file_changes files =
143143
|> List.drop_last_exn
144144
|> String.concat ~sep:"/"
145145
in
146-
if String.is_empty prefix_path then "" else sprintf "modified %d files in `%s/`" (List.length files) prefix_path
146+
sprintf "modified %d files%s" (List.length files)
147+
(if String.is_empty prefix_path then "" else sprintf " in `%s/`" prefix_path)
147148

148149
let populate_commit ?(include_changes = true) repository (commit : api_commit) =
149150
let ({ sha; commit; url; author; files; _ } : api_commit) = commit in

test/slack_payloads.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ will unfurl in #C047QTRD1CH
601601
"fallback": "[9d20f77f] test: added tests for link unfurling - Sewen Thy",
602602
"mrkdwn_in": [ "text" ],
603603
"color": "#f6f8fa",
604-
"text": "`<https://github.com/ahrefs/monorobot/commit/9d20f77fd7c79f5a00978ae91340603159921cb1|9d20f77f>` test: added tests for link unfurling - Sewen Thy\n",
604+
"text": "`<https://github.com/ahrefs/monorobot/commit/9d20f77fd7c79f5a00978ae91340603159921cb1|9d20f77f>` test: added tests for link unfurling - Sewen Thy\n\n\nmodified 14 files",
605605
"footer": "<https://github.com/ahrefs/monorobot|ahrefs/monorobot>"
606606
}
607607
}
@@ -616,7 +616,7 @@ will unfurl in #C047QTRD1CH
616616
"fallback": "[858b5e1d] test: test for ignoring user comment on PR - Sewen Thy[88372442] cfg and action: add support to ignore comments from certain users - Sewen Thy[6ec6b47d] Merge pull request #126 from sewenthy/sewen/121-ignore-code-comments-from-defined-list-of-users\n\nIgnore code comments from defined list of users - Louis",
617617
"mrkdwn_in": [ "text" ],
618618
"color": "#f6f8fa",
619-
"text": "`<https://github.com/sewenthy/monorobot/commit/858b5e1d2de2716883a7f83f69676cb1d05a6c9f|858b5e1d>` test: test for ignoring user comment on PR - Sewen Thy\n`<https://github.com/sewenthy/monorobot/commit/883724426505ec03e29a1e4fd11079797a30bd57|88372442>` cfg and action: add support to ignore comments from certain users - Sewen Thy\n`<https://github.com/sewenthy/monorobot/commit/6ec6b47d1f333d30d5c3889e05dcaad078f0e77d|6ec6b47d>` Merge pull request #126 from sewenthy/sewen/121-ignore-code-comments-from-defined-list-of-users - <https://github.com/Khady|Louis>\n",
619+
"text": "`<https://github.com/sewenthy/monorobot/commit/858b5e1d2de2716883a7f83f69676cb1d05a6c9f|858b5e1d>` test: test for ignoring user comment on PR - Sewen Thy\n`<https://github.com/sewenthy/monorobot/commit/883724426505ec03e29a1e4fd11079797a30bd57|88372442>` cfg and action: add support to ignore comments from certain users - Sewen Thy\n`<https://github.com/sewenthy/monorobot/commit/6ec6b47d1f333d30d5c3889e05dcaad078f0e77d|6ec6b47d>` Merge pull request #126 from sewenthy/sewen/121-ignore-code-comments-from-defined-list-of-users - <https://github.com/Khady|Louis>\n\n\nmodified 6 files",
620620
"footer": "<https://github.com/sewenthy/monorobot|sewenthy/monorobot>"
621621
}
622622
}
@@ -631,7 +631,7 @@ will unfurl in #C047QTRD1CH
631631
"fallback": "[9d20f77f] test: added tests for link unfurling - Sewen Thy",
632632
"mrkdwn_in": [ "text" ],
633633
"color": "#f6f8fa",
634-
"text": "`<https://github.com/ahrefs/monorobot/commit/9d20f77fd7c79f5a00978ae91340603159921cb1|9d20f77f>` test: added tests for link unfurling - Sewen Thy\n",
634+
"text": "`<https://github.com/ahrefs/monorobot/commit/9d20f77fd7c79f5a00978ae91340603159921cb1|9d20f77f>` test: added tests for link unfurling - Sewen Thy\n\n\nmodified 14 files",
635635
"footer": "<https://github.com/ahrefs/monorobot|ahrefs/monorobot>"
636636
}
637637
}
@@ -646,7 +646,7 @@ will unfurl in #C047QTRD1CH
646646
"fallback": "[0e222cde] use plaintext for all fallback messages - Yasunari Watanabe[46b04204] escape all user text and provide pretty-printing utility functions\n\nPR titles, comments, etc. should all be escaped. - Yasunari Watanabe[ee52fb2d] tests: promote with simple char escape check - Yasunari Watanabe",
647647
"mrkdwn_in": [ "text" ],
648648
"color": "#f6f8fa",
649-
"text": "`<https://github.com/ahrefs/monorobot/commit/0e222cdeeee469bf2109310d27d61a8afb86a118|0e222cde>` use plaintext for all fallback messages - <https://github.com/yasunariw|Yasunari Watanabe>\n`<https://github.com/ahrefs/monorobot/commit/46b04204b085fd1d2b8c15033deaa3be0a0f9936|46b04204>` escape all user text and provide pretty-printing utility functions - <https://github.com/yasunariw|Yasunari Watanabe>\n`<https://github.com/ahrefs/monorobot/commit/ee52fb2df818b3b46d81a3f5fa5de2c926987462|ee52fb2d>` tests: promote with simple char escape check - <https://github.com/yasunariw|Yasunari Watanabe>\n",
649+
"text": "`<https://github.com/ahrefs/monorobot/commit/0e222cdeeee469bf2109310d27d61a8afb86a118|0e222cde>` use plaintext for all fallback messages - <https://github.com/yasunariw|Yasunari Watanabe>\n`<https://github.com/ahrefs/monorobot/commit/46b04204b085fd1d2b8c15033deaa3be0a0f9936|46b04204>` escape all user text and provide pretty-printing utility functions - <https://github.com/yasunariw|Yasunari Watanabe>\n`<https://github.com/ahrefs/monorobot/commit/ee52fb2df818b3b46d81a3f5fa5de2c926987462|ee52fb2d>` tests: promote with simple char escape check - <https://github.com/yasunariw|Yasunari Watanabe>\n\n\nmodified 3 files",
650650
"footer": "<https://github.com/ahrefs/monorobot|ahrefs/monorobot>"
651651
}
652652
}

0 commit comments

Comments
 (0)