非master分支代码,不做任何处理
This commit is contained in:
parent
1d28f47dff
commit
ba67c79b0d
@ -16,6 +16,14 @@ func main() {
|
||||
router := gin.Default()
|
||||
// 注册回调路由
|
||||
_ = git_hook.RegisterGitHookRouter(router, func(ctx *gin.Context, hookData *git_hook.HookData) *git_hook.ResponseData {
|
||||
if hookData.Ref != "refs/heads/master" {
|
||||
// 不是master分支, 不触发相应逻辑
|
||||
return &git_hook.ResponseData{
|
||||
Code: 0,
|
||||
Message: "成功接收到web hook通知, 非master分支,不做任何处理",
|
||||
Data: hookData,
|
||||
}
|
||||
}
|
||||
return &git_hook.ResponseData{
|
||||
Code: 0,
|
||||
Message: "成功接收到web hook通知",
|
||||
|
Loading…
Reference in New Issue
Block a user