Pull Request Notification to Enterprise WeChat Group
About 176 wordsLess than 1 minute
Add Group Bot
Add a bot in your Enterprise WeChat group and copy the obtained Webhook
URL.
Configure Pipeline
Example:
main:
pull_request:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
content: |
> **Pull Request Needs Review:**
> **Title:** ${CNB_PULL_REQUEST_TITLE}
> **Creator:** ${CNB_PULL_REQUEST_PROPOSER}
> [View Details]($CNB_EVENT_URL)
pull_request.changes_requested:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
content: |
> **Pull Request Needs Improvement:**
> **Title:** ${CNB_PULL_REQUEST_TITLE}
> **Creator:** ${CNB_PULL_REQUEST_PROPOSER}
> **Reviewer:** ${CNB_BUILD_USER}
> [View Details]($CNB_EVENT_URL)
pull_request.merged:
- stages:
- name: notice
image: tencentcom/wecom-message
settings:
robot: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
content: |
> **Pull Request Merged:**
> **Title:** ${CNB_PULL_REQUEST_TITLE}
> **Creator:** ${CNB_PULL_REQUEST_PROPOSER}
> [View Details]($CNB_EVENT_URL)
pull_request.mergeable:
- stages:
- name: auto merge
type: git:auto-merge
options:
mergeType: squash
removeSourceBranch: true
- name: notice
image: tencentcom/wecom-message
settings:
robot: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
content: |
> **Pull Request Auto-Merged:**
> **Title:** ${CNB_PULL_REQUEST_TITLE}
> **Creator:** ${CNB_PULL_REQUEST_PROPOSER}
> [View Details]($CNB_EVENT_URL)
Fill in the previously copied Webhook
URL for the robot
parameter.
The message format can be customized. Available variables refer to Environment Variables.