diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts
index c79dee66..a009ca39 100644
--- a/packages/core/pipeline/src/core/executor.ts
+++ b/packages/core/pipeline/src/core/executor.ts
@@ -438,7 +438,7 @@ export class Executor {
const runnableError = error as RunnableError;
content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n`;
for (const re of runnableError.errors) {
- content += ` - ${re.runnable.title} 执行失败\n 错误详情:${re.e.message}\n\n`;
+ content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e?.error?.message}\n\n`;
}
} else {
content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n${this.currentStatusMap?.currentStep?.title} 执行失败\n\n错误详情:${error.message}`;
diff --git a/packages/ui/certd-server/src/plugins/plugin-notification/feishu/index.ts b/packages/ui/certd-server/src/plugins/plugin-notification/feishu/index.ts
index 031eb1c7..bc79c468 100644
--- a/packages/ui/certd-server/src/plugins/plugin-notification/feishu/index.ts
+++ b/packages/ui/certd-server/src/plugins/plugin-notification/feishu/index.ts
@@ -98,11 +98,11 @@ export class DingTalkNotification extends BaseNotification {
if(nameIndex>0){
name = id.substring(nameIndex+1)
}
- return `${name}`
+ return `${name}`
}).join("");
}
if(this.isAtAll){
- atText = `所有人`
+ atText = `所有人`
}
if (atText){
@@ -118,16 +118,78 @@ export class DingTalkNotification extends BaseNotification {
}
}
+ const cardBody = {
+ "msg_type": "interactive",
+ "card": {
+ "schema": "2.0",
+ "config": {
+ "update_multi": true,
+ "style": {
+ "text_size": {
+ "normal_v2": {
+ "default": "normal",
+ "pc": "normal",
+ "mobile": "heading"
+ }
+ }
+ }
+ },
+ "header": {
+ "title": {
+ "tag": "plain_text",
+ "content": body.title
+ },
+ "subtitle": {
+ "tag": "plain_text",
+ "content": ""
+ },
+ "template": body.errorMessage?"red":"green",
+ "padding": "12px 12px 12px 12px"
+ },
+ "body": {
+ "direction": "vertical",
+ "padding": "12px 12px 12px 12px",
+ "elements": [
+ {
+ "tag": "markdown",
+ "content": body.content+atText,
+ "text_align": "left",
+ "text_size": "normal_v2",
+ "margin": "0px 0px 0px 0px"
+ },
+ {
+ "tag": "button",
+ "text": {
+ "tag": "plain_text",
+ "content": "查看详情"
+ },
+ "type": "default",
+ "width": "default",
+ "size": "medium",
+ "behaviors": [
+ {
+ "type": "open_url",
+ "default_url": body.url,
+ "pc_url": "",
+ "ios_url": "",
+ "android_url": ""
+ }
+ ],
+ "margin": "0px 0px 0px 0px"
+ }
+ ]
+ },
+
+ }
+ }
+
const res = await this.http.request({
url: webhook,
method: 'POST',
data: {
...sign,
- content: {
- text: `${body.title}\n${body.content}\n查看详情: ${body.url}${atText}`,
- },
- msg_type:"text"
+ ...cardBody
},
});
if(res.code>100){