我看了一下这些文档,看来你错过了以下几行:
when: status: [ success, failure ]
该 文档 州:
成功和失败消息的配置示例:
pipeline: slack: image: plugins/slack webhook: https://hooks.slack.com/services/... channel: dev when: status: [ success, failure ]
您还可以添加自定义消息:
使用自定义消息模板的示例配置:
pipeline: slack: image: plugins/slack webhook: https://hooks.slack.com/services/... channel: dev template: > {{#success build.status}} build {{build.number}} succeeded. Good job. {{else}} build {{build.number}} failed. Fix me please. {{/success}}