Issue Notification to Enterprise WeChat Group
About 292 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.
Each Issue lifecycle event corresponds to one pipeline configuration under $.{event}:
Notify when an Issue is opened:
.cnb.yml
$:
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)Notify when an Issue is reopened:
.cnb.yml
$:
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)Notify when an Issue is closed:
.cnb.yml
$:
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)Multiple events can share the same Enterprise WeChat group bot Webhook URL (injected via env):
.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.