File tree Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,6 @@ inputs:
1313 description : " The directory where your blog posts are stored"
1414 default : " blog"
1515 required : false
16- message_template :
17- description : " The template of the message to send"
18- default : " **📢 博客变更通知**\n 分支: ${refName}\n 提交信息: ${commitMessage}\n 提交人: ${actor}\n\n **新增博客文章**:\n ${addedBlogs || '无新增博客'}\n\n **更新博客文章**:\n ${updatedBlogs || '无更新博客'}"
19- required : false
2016
2117runs :
2218 using : " node20" # 使用 Node.js 运行环境
Original file line number Diff line number Diff line change @@ -44087,7 +44087,6 @@ const path = __nccwpck_require__(1017);
4408744087 const webhook = core.getInput('wechat_webhook');
4408844088 const baseUrl = core.getInput('base_url');
4408944089 const blogDir = core.getInput('blog_dir');
44090- const messageTemplate = core.getInput('message_template');
4409144090
4409244091 if (!webhook) {
4409344092 throw new Error('WeChat webhook is required.');
@@ -44165,11 +44164,10 @@ const path = __nccwpck_require__(1017);
4416544164 }
4416644165
4416744166 // Prepare message content
44168- const render = new Function("return `" + messageTemplate + "`;");
4416944167 const message = {
4417044168 msgtype: 'markdown',
4417144169 markdown: {
44172- content: render(),
44170+ content: `**📢 博客变更通知**\n分支: ${refName}\n提交信息: ${commitMessage}\n提交人: ${actor}\n\n**新增博客文章**:\n${addedBlogs || '无新增博客'}\n\n**更新博客文章**:\n${updatedBlogs || '无更新博客'}`
4417344171 }
4417444172 };
4417544173 // Send message to WeChat robot
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ const path = require('path');
1111 const webhook = core . getInput ( 'wechat_webhook' ) ;
1212 const baseUrl = core . getInput ( 'base_url' ) ;
1313 const blogDir = core . getInput ( 'blog_dir' ) ;
14- const messageTemplate = core . getInput ( 'message_template' ) ;
1514
1615 if ( ! webhook ) {
1716 throw new Error ( 'WeChat webhook is required.' ) ;
@@ -89,11 +88,10 @@ const path = require('path');
8988 }
9089
9190 // Prepare message content
92- const render = new Function ( "return `" + messageTemplate + "`;" ) ;
9391 const message = {
9492 msgtype : 'markdown' ,
9593 markdown : {
96- content : render ( ) ,
94+ content : `**📢 博客变更通知**\n分支: ${ refName } \n提交信息: ${ commitMessage } \n提交人: ${ actor } \n\n**新增博客文章**:\n ${ addedBlogs || '无新增博客' } \n\n**更新博客文章**:\n ${ updatedBlogs || '无更新博客' } `
9795 }
9896 } ;
9997 // Send message to WeChat robot
You can’t perform that action at this time.
0 commit comments