diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index a009ca39..dd6d23d2 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -218,7 +218,7 @@ export class Executor { returnType: ResultType.error, runnable: t, }); - errorMessage += `任务${t.title}执行失败,错误详情:${e.message};`; + errorMessage += `任务${t.title}执行失败,错误详情:${e.message};`; } } if (errorList.length > 0) { @@ -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} 执行失败,错误详情:${re.e?.error?.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/dingtalk/index.ts b/packages/ui/certd-server/src/plugins/plugin-notification/dingtalk/index.ts index e97e19ae..e875f1bd 100644 --- a/packages/ui/certd-server/src/plugins/plugin-notification/dingtalk/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-notification/dingtalk/index.ts @@ -125,15 +125,17 @@ export class DingTalkNotification extends BaseNotification { at.isAtAll = true; } + const color = body.errorMessage?'red':'green'; const res = await this.http.request({ url: webhook, method: 'POST', data: { at: at, - text: { - content: `${body.title}\n${body.content}\n查看详情: ${body.url}`, + markdown: { + title: body.title, + text: `${body.title}\n\n\n ${body.content}\n\n\n[查看详情](${body.url})`, }, - msgtype:"text" + msgtype:"markdown" }, }); if(res.errcode>100){