File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ open Base
2
2
open Printf
3
3
open Github_t
4
4
open Slack_t
5
-
6
- let git_short_sha_hash hash = String. sub ~pos: 0 ~len: 8 hash
5
+ open Common
6
+ open Mrkdwn
7
7
8
8
let empty_attachment =
9
9
{
@@ -25,14 +25,18 @@ let empty_attachment =
25
25
}
26
26
27
27
let base_attachment (repository : repository ) =
28
- { empty_attachment with footer = Some (sprintf " <%s|%s>" repository.url repository.full_name) }
28
+ { empty_attachment with footer = Some (sprintf " <%s|%s>" repository.url (escape_mrkdwn repository.full_name) ) }
29
29
30
30
let pp_file (file : file ) = sprintf " <%s|%s>" file.url (Mrkdwn. escape_mrkdwn file.filename)
31
31
32
32
let populate_commit repository (commit : api_commit ) =
33
33
let ({ sha; commit; url; author; files; stats } : api_commit ) = commit in
34
34
let get_files () = List. map files ~f: pp_file in
35
- let title = sprintf " `<%s|%s>` *%s - %s*" url (git_short_sha_hash sha) commit.message commit.author.name in
35
+ let title =
36
+ sprintf " `<%s|%s>` *%s - %s*" url (Slack. git_short_sha_hash sha)
37
+ (escape_mrkdwn @@ first_line commit.message)
38
+ (escape_mrkdwn commit.author.name)
39
+ in
36
40
let num_change = List. length files in
37
41
let changes =
38
42
sprintf " %d %s with %d %s and %d %s:" num_change
You can’t perform that action at this time.
0 commit comments