gpt4 book ai didi

jenkins - 如何在 Jenkins 管道 webhook 中为 office365Connector 添加备注、提交者和开发人员

转载 作者:行者123 更新时间:2023-12-05 03:48:19 24 4
gpt4 key购买 nike

我已经像这样在管道中设置了 office365Connector。如何添加自动备注,如由 SCM 更改启动或由用户 SoAndSo 启动。以及如何添加提交者和开发者..

post{
success{
office365ConnectorSend(
status: "Build Success",
webhookUrl: "Url",
color: '00ff00',
message: "Some Message"
)

}
failure{
office365ConnectorSend(
status: "Build Failed",
webhookUrl: "UrL",
color: 'ff4000',
message: "The build has failed, please check build logs"
)
}

最佳答案

如果你想@mention 某人,jenkins 的 office365 插件仍然不可用

要获取启动构建的用户,请参阅此 answer

要获取提交者的电子邮件,请参阅 answer

如果你真的想像我一样提及用户,你可以:

  • 如果你懂 java,创建一个 PR 来解决这个 issue在官方 repo

  • 如果您不懂 java,或者抽不出时间,您将不得不一起破解:

  1. 这就是您使用 curl 的方式来自管道

  2. 现在您必须从User graph api 中获取用户

  3. 将 webhook 添加为 jenkins 上的凭据,如下所示: enter image description here

因此您可以在管道中调用它:

office365ConnectorSend message: "Hello", webhookUrl: credentials("wh-msteams-dev")
  1. 发送adaptive card ,这是目前唯一支持提及的类型,这是来自文档的示例:
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Hi <at>John Doe</at>"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>John Doe</at>",
"mentioned": {
"id": "29:123124124124",
"name": "John Doe"
}
}
]
}
}
}

不,这不是微不足道的。

是的,我也为这种提及的糟糕程度感到痛苦。

失望,但并不意外。毕竟这是 Microsoft Teams。

请生存。

关于jenkins - 如何在 Jenkins 管道 webhook 中为 office365Connector 添加备注、提交者和开发人员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64453662/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com