From 2c8ab1428b2bebd5f8974f7c31d711f3d908b736 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 11 Dec 2019 10:34:52 +0800 Subject: [PATCH] chore(drone): update default template. Signed-off-by: Bo-Yi Wu --- plugin.go | 18 +++++++++++++----- plugin_test.go | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plugin.go b/plugin.go index 7dc760a..fe87497 100644 --- a/plugin.go +++ b/plugin.go @@ -108,7 +108,7 @@ type ( ) var icons = map[string]string{ - "failure": "❗", + "failure": "❌", "cancelled": "❕", "success": "✅", } @@ -453,12 +453,20 @@ func (p Plugin) Message() []string { )} } - return []string{fmt.Sprintf("%s *%s*: [%s](%s)『%s』by %s", + // ✅ Build #106 of drone-telegram succeeded. + // + // 📝 Commit by appleboy on master: + // chore: update default template + // + // 🌐 https://cloud.drone.io/appleboy/drone-telegram/106 + return []string{fmt.Sprintf("%s Build #%d of `%s` %s.\n\n📝 Commit by %s on `%s`:\n``` %s ```\n\n🌐 %s", icon, - p.Build.Status, + p.Build.Number, p.Repo.FullName, - p.Build.Link, - p.Commit.Message, + p.Build.Status, p.Commit.Author, + p.Commit.Branch, + p.Commit.Message, + p.Build.Link, )} } diff --git a/plugin_test.go b/plugin_test.go index 08d37df..b55e594 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -49,7 +49,7 @@ func TestDefaultMessageFormat(t *testing.T) { message := plugin.Message() - assert.Equal(t, []string{"✅ *success*: [appleboy/go-hello](https://github.com/appleboy/go-hello)『update travis』by Bo-Yi Wu"}, message) + assert.Equal(t, []string{"✅ Build #101 of `appleboy/go-hello` success.\n\n📝 Commit by Bo-Yi Wu on `master`:\n``` update travis ```\n\n🌐 https://github.com/appleboy/go-hello"}, message) } func TestDefaultMessageFormatFromGitHub(t *testing.T) {