Skip to content

Commit e062ad8

Browse files
authored
Merge pull request #32 from haind-2716/haind/fix_to_here
fix message to here
2 parents d32e640 + b2bf2cc commit e062ad8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cmd/deploy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (d *deploy) exec() error {
104104

105105
success := color.New(color.FgHiGreen, color.Bold).PrintlnFunc()
106106
success("Successfully deployed!")
107-
d.notify.Push("SUCCESS!")
107+
d.notify.Push("SUCCESS! :green-check-mark:")
108108

109109
return nil
110110
}
@@ -118,7 +118,7 @@ func (d *deploy) commands(t *task.Task, cmds string) error {
118118
sp.Start()
119119
out, _ := utils.Call(d.mfuncs, cmds, t)
120120
if !out[0].IsNil() {
121-
d.notify.Push("FAILED!")
121+
d.notify.Push("FAILED! :error:")
122122
log.Fatalf("Error: %v", out[0].Interface())
123123
}
124124
sp.Stop()

cmd/task/notify.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ func (n *Notify) doSendOther(status string) (resq []byte, err error) {
9292
n.address,
9393
)
9494

95-
block := fmt.Sprintf(`{"type": "section", "text": {"type": "mrkdwn", "text": "Build Status: %s\n%s"}}`,
95+
block := fmt.Sprintf(`{"type": "section", "text": {"type": "mrkdwn", "text": "\n>Build Status: %s\n>%s :git:"}}`,
9696
status,
9797
n.feature,
9898
)
99+
here := fmt.Sprintf(`{"type": "section","fields": [{"type": "mrkdwn","text": "@here"}]}`)
99100

100-
postBody := []byte(fmt.Sprintf(`{"service": "slack", "channel": "%s", "receivers": "here", "message": "%s", "blocks": [%s, %s]}`,
101+
postBody := []byte(fmt.Sprintf(`{"service": "slack", "channel": "%s", "receivers": "here", "message": "%s", "blocks": [%s,%s,%s]}`,
101102
n.otherChannel,
102103
status,
104+
here,
103105
title,
104106
block,
105107
))

0 commit comments

Comments
 (0)