This example demonstrates how to configure notifications for issue creation, closure, and reopening in group chats.
issue.open event: Triggers when an issue is created, notifying the group chatissue.reopen event: Triggers when a closed issue is reopened, notifying the group chatissue.close event: Triggers when an issue is closed, notifying the group chatpush event: After push, automatically updates issue labels using git:issue-updateConfiguration Example:
# .cnb.yml
main:
push:
- stages:
- name: Update issue
type: git:issue-update
options:
label:
add: Resolved
remove: In Development
$:
issue.open:
- stages:
- name: Notify group about new issue
image: tencentcom/wecom-message
imports: https://cnb.cool/xxx/xxx/-/blob/main/envs/wework-robots.yml
settings:
robot: $REVIEW_ROBOT_ID
msgType: markdown
content: |
> **New Issue Created**
> **Title:** $CNB_ISSUE_TITLE
> **Author:** $CNB_ISSUE_OWNER
> [View Details]($CNB_EVENT_URL)
issue.reopen:
- stages:
- name: Notify group about reopened issue
image: tencentcom/wecom-message
imports: https://cnb.cool/xxx/xxx/-/blob/main/envs/wework-robots.yml
settings:
robot: $REVIEW_ROBOT_ID
content: |
> **$CNB_BUILD_USER reopened an issue**
> **Title:** $CNB_ISSUE_TITLE
> **Author:** $CNB_ISSUE_OWNER
> [View Details]($CNB_EVENT_URL)
${REVIEWED_BY}
issue.close:
- stages:
- name: Notify group about closed issue
image: tencentcom/wecom-message
imports: https://cnb.cool/xxx/xxx/-/blob/main/envs/wework-robots.yml
settings:
robot: $REVIEW_ROBOT_ID
content: |
> **$CNB_BUILD_USER closed an issue**
> **Title:** $CNB_ISSUE_TITLE
> **Author:** $CNB_ISSUE_OWNER
> [View Details]($CNB_EVENT_URL)