Name | Updated at | |
---|---|---|
.cnb.yml | ||
LICENSE.txt | ||
README.md |
示例中,配置了如何将 CODE REVIEW 消息通知到群聊
配置示例:
# .cnb.yml
main:
pull_request:
- stages:
- name: 添加评审人
type: git:reviewer
options:
type: add-reviewer
count: 2
exports:
reviewersForAt: CURR_REVIEWER_FOR_AT
- name: 评审信息通知到群聊
# 从密钥仓库导入环境变量配置
# 使用密钥仓库保存机器人 id,避免 id 泄露
imports: https://cnb.cool/xxx/xxx/-/blob/main/envs/wework-robots.yml
image: tencentcom/wecom-message
settings:
# robot id 来源于 imports 导入的环境变量
robot: $REVIEW_ROBOT_ID
content: |
${CNB_PULL_REQUEST_TITLE}
[${CNB_EVENT_URL}](${CNB_EVENT_URL})
${CURR_REVIEWER_FOR_AT}
from ${CNB_BUILD_USER}
pull_request.mergeable:
- stages:
- name: CR 通过后自动合并
type: git:auto-merge
options:
mergeType: squash
removeSourceBranch: true
exports:
reviewedBy: REVIEWED_BY
- name: CR 通过后通知到群聊
# 从密钥仓库导入环境变量配置
# 使用密钥仓库保存机器人 id,避免 id 泄露
imports: https://cnb.cool/xxx/xxx/-/blob/main/envs/wework-robots.yml
image: tencentcom/wecom-message
settings:
# robot id 来源于 imports 导入的环境变量
robot: $REVIEW_ROBOT_ID
msgType: markdown
content: |
CR 通过后自动合并: <@${CNB_PULL_REQUEST_PROPOSER}>
${CNB_PULL_REQUEST_TITLE}
[${CNB_EVENT_URL}](${CNB_EVENT_URL})
${REVIEWED_BY}