Skip to content

Commit

Permalink
Merge pull request #32 from haind-2716/haind/fix_to_here
Browse files Browse the repository at this point in the history
fix message to here
  • Loading branch information
dung13890 authored Nov 30, 2022
2 parents d32e640 + b2bf2cc commit e062ad8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (d *deploy) exec() error {

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

return nil
}
Expand All @@ -118,7 +118,7 @@ func (d *deploy) commands(t *task.Task, cmds string) error {
sp.Start()
out, _ := utils.Call(d.mfuncs, cmds, t)
if !out[0].IsNil() {
d.notify.Push("FAILED!")
d.notify.Push("FAILED! :error:")
log.Fatalf("Error: %v", out[0].Interface())
}
sp.Stop()
Expand Down
6 changes: 4 additions & 2 deletions cmd/task/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,16 @@ func (n *Notify) doSendOther(status string) (resq []byte, err error) {
n.address,
)

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

postBody := []byte(fmt.Sprintf(`{"service": "slack", "channel": "%s", "receivers": "here", "message": "%s", "blocks": [%s, %s]}`,
postBody := []byte(fmt.Sprintf(`{"service": "slack", "channel": "%s", "receivers": "here", "message": "%s", "blocks": [%s,%s,%s]}`,
n.otherChannel,
status,
here,
title,
block,
))
Expand Down

0 comments on commit e062ad8

Please sign in to comment.