Issue Notification to Enterprise WeChat Group
About 208 wordsLess than 1 minute
Add Group Bot
Add a bot to your Enterprise WeChat group and copy the obtained Webhook URL.
Configure Pipeline
Fill in the robot field with the copied Webhook URL. We recommend injecting it via env (avoid hardcoding sensitive values); the example below references it uniformly through WECOM_ROBOT. Add the following configuration to .cnb.yml. Multiple Issue lifecycle events can be placed under the same $. — all events share the same Enterprise WeChat group bot Webhook URL:
.cnb.yml
env:
WECOM_ROBOT: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
$:
issue.open:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: $WECOM_ROBOT
content: |
> **New Issue Created**
> **Title:** $CNB_ISSUE_TITLE
> **Creator:** $CNB_ISSUE_OWNER
> [View Details]($CNB_EVENT_URL)
issue.reopen:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: $WECOM_ROBOT
content: |
> **Issue Reopened**
> **Title:** $CNB_ISSUE_TITLE
> [View Details]($CNB_EVENT_URL)
issue.close:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: $WECOM_ROBOT
content: |
> **$CNB_BUILD_USER closed an issue**
> **Title:** $CNB_ISSUE_TITLE
> [View Details]($CNB_EVENT_URL)The pipeline triggerer is the user who created, closed, or reopened the Issue.
The message format can be customized. For available variables, see Environment Variables.