LeoEatle / git-webhook-wework-robot

企业微信github/gitlab机器人
289 stars 79 forks source link

gitlab的issues评论 #30

Open sky5454 opened 3 years ago

sky5454 commented 3 years ago
async function handleNote(body, robotid) {
    const robot = new ChatRobot(
        robotid || config.chatid
    );
    const { user, project, issue, object_attributes, repository } = body;
    const { noteable_type, url } = object_attributes;
    if (noteable_type === 'Issue') {
        const mdMsg = `${user.name} 评论了[${repository.name}](${repository.url})的issue[${issue.title}]
                        评论:${object_attributes.note}
                        [查看详情](${url})`
        await robot.sendMdMsg(mdMsg);
    }
    return;
}

仅支持文字,gitlab8中文社区版

新增对 ISSUE 评论的支持(标题、ISSUE名 )

LeoEatle commented 3 years ago

这些可以自己随意修改,把我的云函数代码当成一个模板就好