File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39814,6 +39814,11 @@ const path = __nccwpck_require__(1017);
39814
39814
const webhook = core.getInput('wechat_webhook');
39815
39815
const baseUrl = core.getInput('base_url');
39816
39816
const blogDir = core.getInput('blog_dir');
39817
+ const messageTemplate = core.getInput('message_template');
39818
+
39819
+ if (!webhook) {
39820
+ throw new Error('WeChat webhook is required.');
39821
+ }
39817
39822
39818
39823
// 定义一个函数,用于从 frontmatter 中提取 slug
39819
39824
function extractSlugAndTitle(file) {
@@ -39879,14 +39884,15 @@ const path = __nccwpck_require__(1017);
39879
39884
}
39880
39885
39881
39886
// Prepare message content
39887
+ const render = new Function("return `" + messageTemplate + "`;");
39882
39888
const message = {
39883
39889
msgtype: 'markdown',
39884
39890
markdown: {
39885
- content: ``
39891
+ content: render(),
39886
39892
}
39887
39893
};
39888
-
39889
39894
// Send message to WeChat robot
39895
+ console.log(message);
39890
39896
await axios.post(webhook, message, { headers: { 'Content-Type': 'application/json' } });
39891
39897
console.log('Notification sent to WeChat robot success.');
39892
39898
} catch (error) {
You can’t perform that action at this time.
0 commit comments