mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 08:23:48 +02:00
Update Slack plugin config (Closes #612)
This commit is contained in:
parent
91c2678b3d
commit
7c27628976
@ -8,7 +8,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
slackEndpoint = "https://%s.slack.com/services/hooks/incoming-webhook?token=%s"
|
|
||||||
slackStartedMessage = "*Building* <%s|%s> (%s) by %s"
|
slackStartedMessage = "*Building* <%s|%s> (%s) by %s"
|
||||||
slackStartedFallbackMessage = "Building %s (%s) by %s"
|
slackStartedFallbackMessage = "Building %s (%s) by %s"
|
||||||
slackSuccessMessage = "*Success* <%s|%s> (%s) by %s"
|
slackSuccessMessage = "*Success* <%s|%s> (%s) by %s"
|
||||||
@ -18,10 +17,9 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Slack struct {
|
type Slack struct {
|
||||||
Team string `yaml:"team,omitempty"`
|
WebhookUrl string `yaml:"webhook_url,omitempty"`
|
||||||
Channel string `yaml:"channel,omitempty"`
|
Channel string `yaml:"channel,omitempty"`
|
||||||
Username string `yaml:"username,omitempty"`
|
Username string `yaml:"username,omitempty"`
|
||||||
Token string `yaml:"token,omitempty"`
|
|
||||||
Started bool `yaml:"on_started,omitempty"`
|
Started bool `yaml:"on_started,omitempty"`
|
||||||
Success bool `yaml:"on_success,omitempty"`
|
Success bool `yaml:"on_success,omitempty"`
|
||||||
Failure bool `yaml:"on_failure,omitempty"`
|
Failure bool `yaml:"on_failure,omitempty"`
|
||||||
@ -100,10 +98,7 @@ func (s *Slack) send(msg string, fallback string, color string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// send payload
|
go sendJson(s.WebhookUrl, payload, nil)
|
||||||
url := fmt.Sprintf(slackEndpoint, s.Team, s.Token)
|
|
||||||
|
|
||||||
go sendJson(url, payload, nil)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user