File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed
Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,16 @@ def intro_block(start_text, environment)
5858 output
5959end
6060
61- def commits_block ( environment )
62- output = ""
63- messages = commits_since_last_deploy . reverse . map do |commit |
64- output += "\n + #{ commit [ 0 ] } | ##{ commit [ 1 ] [ 0 ..5 ] } "
61+ def commit_blocks ( environment )
62+ outputs = [ ]
63+ commits_since_last_deploy . reverse . each_slice ( 50 ) do |commits |
64+ output = ""
65+ commits . map do |commit |
66+ output += "\n + #{ commit [ 0 ] } | ##{ commit [ 1 ] [ 0 ..5 ] } "
67+ end
68+ outputs . push ( output )
6569 end
66- output
70+ outputs
6771end
6872
6973def links_block ( environment )
@@ -100,13 +104,15 @@ namespace :hook do
100104 "text" : intro_block ( notification_text , environment ) ,
101105 }
102106 } ,
103- {
104- "type" : "section" ,
105- "text" : {
106- "type" : "mrkdwn" ,
107- "text" : commits_block ( environment ) ,
107+ *commit_blocks ( environment ) . map do |commit_block_text |
108+ {
109+ "type" : "section" ,
110+ "text" : {
111+ "type" : "mrkdwn" ,
112+ "text" : commit_block_text ,
113+ }
108114 }
109- } ,
115+ end ,
110116 {
111117 "type" : "section" ,
112118 "text" : {
You can’t perform that action at this time.
0 commit comments