chore(drone): update default template.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
602b560c4d
commit
2c8ab1428b
18
plugin.go
18
plugin.go
@ -108,7 +108,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var icons = map[string]string{
|
var icons = map[string]string{
|
||||||
"failure": "❗",
|
"failure": "❌",
|
||||||
"cancelled": "❕",
|
"cancelled": "❕",
|
||||||
"success": "✅",
|
"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,
|
icon,
|
||||||
p.Build.Status,
|
p.Build.Number,
|
||||||
p.Repo.FullName,
|
p.Repo.FullName,
|
||||||
p.Build.Link,
|
p.Build.Status,
|
||||||
p.Commit.Message,
|
|
||||||
p.Commit.Author,
|
p.Commit.Author,
|
||||||
|
p.Commit.Branch,
|
||||||
|
p.Commit.Message,
|
||||||
|
p.Build.Link,
|
||||||
)}
|
)}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ func TestDefaultMessageFormat(t *testing.T) {
|
|||||||
|
|
||||||
message := plugin.Message()
|
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) {
|
func TestDefaultMessageFormatFromGitHub(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user