whyour / qinglong

支持 Python3、JavaScript、Shell、Typescript 的定时任务管理平台(Timed task management platform supporting Python3, JavaScript, Shell, Typescript)
https://qinglong.online
Apache License 2.0
16.43k stars 2.99k forks source link

自定义webhook时获取配置的process.env获取到的WEBHOOK_BODY参数中$title和$content会被替换为空 #2419

Closed mikoshu closed 5 months ago

mikoshu commented 5 months ago

Qinglong version

v2.17.7

Steps to reproduce

自定义webhook时获取配置的process.env获取到的WEBHOOK_BODY参数中$title和$content会被替换为空导致无法发送通知 如配置为 "title:$title"在sendNotify中打印出来结果为"title:"导致脚本直接resolve###

What is expected?

如在配置文件中配置WEBHOOK_BODY为 "title:$title"在notify.js中通过process.env['WEBHOOK_BODY']获取出来结果应该也为为"title:$title"才能进行文本替换

What is actually happening?

当前获取的结果为"title:" $title文本被替换为空导致通知脚本无法继续

System Info

No response

Any additional comments?

No response

whyour commented 5 months ago

参考:https://github.com/whyour/qinglong/issues/2303 变量声明要用单引号

export WEBHOOK_BODY='title:$title'$'\n''text:$content'