mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	add webhook default events
This commit is contained in:
		@@ -76,6 +76,9 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(form.Events) == 0 {
 | 
				
			||||||
 | 
							form.Events = []string{"push"}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	w := &models.Webhook{
 | 
						w := &models.Webhook{
 | 
				
			||||||
		RepoID:      ctx.Repo.Repository.ID,
 | 
							RepoID:      ctx.Repo.Repository.ID,
 | 
				
			||||||
		URL:         form.Config["url"],
 | 
							URL:         form.Config["url"],
 | 
				
			||||||
@@ -159,6 +162,9 @@ func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Update events
 | 
						// Update events
 | 
				
			||||||
 | 
						if len(form.Events) == 0 {
 | 
				
			||||||
 | 
							form.Events = []string{"push"}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	w.PushOnly = false
 | 
						w.PushOnly = false
 | 
				
			||||||
	w.SendEverything = false
 | 
						w.SendEverything = false
 | 
				
			||||||
	w.ChooseEvents = true
 | 
						w.ChooseEvents = true
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user