From 74122eb5092030d23a62ba16e4053f6f872f0111 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Fri, 17 Mar 2017 00:21:32 +0900 Subject: [PATCH] Update the message --- src/api/service/github.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/service/github.ts b/src/api/service/github.ts index c60cb25cb..a6eba3d5e 100644 --- a/src/api/service/github.ts +++ b/src/api/service/github.ts @@ -35,12 +35,16 @@ module.exports = async (app: express.Application) => { case 'refs/heads/master': const pusher = event.pusher; const compare = event.compare; - const commits = event.commits.map(commit => `・${commit.message}`).join('\n'); - post(`Pushed by **${pusher.name}**\n${commits}\nCompare changes: ${compare}`); + const commits = event.commits; + post([ + `Pushed by **${pusher.name}** with ${commits.length} commit${commits.length > 1 ? 's' : ''}: ${compare}`, + '', + commits.map(commit => `・${commit.message.split('\n')[0]}`).join('\n'), + ].join('\n')); break; case 'refs/heads/release': const commit = event.commits[0]; - post(`RELEASED🎉: ${commit.message}`); + post(`RELEASED: ${commit.message}`); break; } });