Codebrag supports webhooks which can be used to notify external systems about all internal events.
Just define the hooks
section in your application.conf
file based on the below example.
These are the supported hooks:
like-hook
- occurs when a user likes a given change
unlike-hook
- occurs if a user dislikes the previously liked change
comment-added-hook
- occurs when a user post a comment
commit-reviewed-hook
- occurs when a user hit Reviewed
button
all-commits-reviewed-hook
- occurs when a user hit a button and marked all commits to be reviewed as reviewed at once in current repo for current branch
new-commits-loaded-hook
- occurs after loading by Codebrag new commits from repo
new-user-registered-hook
- occurs on registering a new user in the system
You can define multiple listeners for every hook, just separate urls by comma
Right now Codebrag sends hooks as JSON encoded as UTF-8, below is the list of formats for each hook:
{
"commitInfo": {
"repoName": string,
"sha": string,
"message": string,
"authorName": string,
"authorEmail": string,
"committerName": string,
"committerEmail": string,
"authorDate": date,
"commitDate": date,
"parents": [string, string]
},
"likedBy": {
"name": string,
"emailLowerCase": string,
"aliases": [{
"alias": string
}]
},
"like": {
"postingTime": date,
"fileName": string,
"lineNumber": int
},
"hookName": "like-hook",
"hookDate": date
}
{
"commitInfo": {
"repoName": string,
"sha": string,
"message": string,
"authorName": string,
"authorEmail": string,
"committerName": string,
"committerEmail": string,
"authorDate": date,
"commitDate": date,
"parents": [string, string]
},
"unlikedBy": {
"name": string,
"emailLowerCase": string,
"aliases": [{
"alias": string
}]
},
"like": {
"postingTime": date,
"fileName": string,
"lineNumber": int
},
"hookName": "unlike-hook",
"hookDate": date
}
{
"commitInfo": {
"repoName": string,
"sha": string,
"message": string,
"authorName": string,
"authorEmail": string,
"committerName": string,
"committerEmail": string,
"authorDate": date,
"commitDate": date,
"parents": [string, string]
},
"commentedBy": {
"name": string,
"emailLowerCase": string,
"aliases": [{
"alias": string
}]
},
"comment": {
"message": string,
"postingTime": date,
"fileName": string,
"lineNumber": int
},
"hookName": "comment-added-hook",
"hookDate": date
}
{
"commitInfo": {
"repoName": string,
"sha": string,
"message": string,
"authorName": string,
"authorEmail": string,
"committerName": string,
"committerEmail": string,
"authorDate": date,
"commitDate": date,
"parents": [string, string]
},
"reviewedBy": {
"name": string,
"emailLowerCase": string,
"aliases": [{
"alias": string
}]
},
"hookName": "commit-reviewed-hook",
"hookDate": date
}
{
"repoName": string,
"branchName": string,
"reviewedBy": {
"name": string,
"emailLowerCase": string,
"aliases": [{
"alias": string
}]
},
"hookName": "all-commitc-reviewed-hook",
"hookDate": date
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。