Skip to content

Commit 7be8366

Browse files
author
wujiancheng
committed
add dist
1 parent 176d635 commit 7be8366

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dist/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39814,6 +39814,11 @@ const path = __nccwpck_require__(1017);
3981439814
const webhook = core.getInput('wechat_webhook');
3981539815
const baseUrl = core.getInput('base_url');
3981639816
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+
}
3981739822

3981839823
// 定义一个函数,用于从 frontmatter 中提取 slug
3981939824
function extractSlugAndTitle(file) {
@@ -39879,14 +39884,15 @@ const path = __nccwpck_require__(1017);
3987939884
}
3988039885

3988139886
// Prepare message content
39887+
const render = new Function("return `" + messageTemplate + "`;");
3988239888
const message = {
3988339889
msgtype: 'markdown',
3988439890
markdown: {
39885-
content: ``
39891+
content: render(),
3988639892
}
3988739893
};
39888-
3988939894
// Send message to WeChat robot
39895+
console.log(message);
3989039896
await axios.post(webhook, message, { headers: { 'Content-Type': 'application/json' } });
3989139897
console.log('Notification sent to WeChat robot success.');
3989239898
} catch (error) {

0 commit comments

Comments
 (0)