diff --git a/packages/core/pipeline/src/core/run-history.ts b/packages/core/pipeline/src/core/run-history.ts index fdb26a0c..040f37ab 100644 --- a/packages/core/pipeline/src/core/run-history.ts +++ b/packages/core/pipeline/src/core/run-history.ts @@ -203,6 +203,7 @@ export class RunnableCollection { if (runnable?.status) { runnable.status.status = ResultType.none; runnable.status.result = ResultType.none; + runnable.status.output = {}; runnable.status.inputHash = ""; // @ts-ignore runnable.input = {}; diff --git a/packages/ui/certd-server/src/plugins/plugin-github/plugins/plugin-check-release.ts b/packages/ui/certd-server/src/plugins/plugin-github/plugins/plugin-check-release.ts index bec16417..1b85300b 100644 --- a/packages/ui/certd-server/src/plugins/plugin-github/plugins/plugin-check-release.ts +++ b/packages/ui/certd-server/src/plugins/plugin-github/plugins/plugin-check-release.ts @@ -61,21 +61,23 @@ export class GithubCheckRelease extends AbstractTaskPlugin { } //插件执行方法 - async execute(): Promise { + async execute(): Promise { const access = await this.getAccess(this.accessId); - const res = await access.getRelease({repoName:this.repoName}) - + if(res == null){ + throw new Error(`获取${this.repoName}最新版本失败`) + } const lastVersion = this.ctx.lastStatus?.status?.output?.lastVersion; if(res.tag_name == null || res.tag_name ==lastVersion){ this.logger.info(`暂无更新,${res.tag_name}`); - return + return "skip" } //有更新 - this.logger.info(`有更新,${lastVersion}->${res.tag_name}`) + this.logger.info(`有更新,${lastVersion??"0"}->${res.tag_name}`) this.lastVersion = res.tag_name; + const body = res.body.replaceAll("* ","- ") //发送通知 for (const notificationId of this.notificationIds) { await this.ctx.notificationService.send({ @@ -85,7 +87,7 @@ export class GithubCheckRelease extends AbstractTaskPlugin { logger: this.logger, body: { title: `${this.repoName} 新版本 ${this.lastVersion} 发布`, - content: `${res.body}\n\n >Certd:不止证书自动化,插件解锁无限可能!`, + content: `${body}\n\n > [Certd](https://certd.docmirror.cn),不止证书自动化,插件解锁无限可能!\n\n`, url: `https://github.com/${this.repoName}/releases/tag/${this.lastVersion}`, } }) diff --git a/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts b/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts index c4b92ac7..2d7d45dc 100644 --- a/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-notification/qywx/index.ts @@ -55,14 +55,14 @@ export class QywxNotification extends BaseNotification { * } * } */ - + const color = body.errorMessage?'red':'green'; await this.http.request({ url: this.webhook, method: 'POST', data: { - msgtype: 'text', - text: { - content: `${body.title}\n${body.content}\n查看详情: ${body.url}`, + msgtype: 'markdown', + markdown: { + content: `${body.title}\n\n\n${body.content}\n\n[查看详情](${body.url})`, mentioned_list: this.mentionedList, mentioned_mobile_list: this.mentionedMobileList, },