Skip to content

Commit b4c37bb

Browse files
improve release notifications
1 parent b8b328b commit b4c37bb

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

lib/tasks/hook.rake

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ def intro_block(start_text, environment)
5858
output
5959
end
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
6771
end
6872

6973
def 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": {

0 commit comments

Comments
 (0)