summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go
index 4f357cb2c5..c3ed9c7c02 100644
--- a/models/action.go
+++ b/models/action.go
@@ -618,6 +618,16 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
case ActionDeleteBranch: // Delete Branch
isHookEventPush = true
+ if err = PrepareWebhooks(repo, HookEventDelete, &api.DeletePayload{
+ Ref: refName,
+ RefType: "branch",
+ PusherType: api.PusherTypeUser,
+ Repo: apiRepo,
+ Sender: apiPusher,
+ }); err != nil {
+ return fmt.Errorf("PrepareWebhooks.(delete branch): %v", err)
+ }
+
case ActionPushTag: // Create
isHookEventPush = true
@@ -640,6 +650,16 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
}
case ActionDeleteTag: // Delete Tag
isHookEventPush = true
+
+ if err = PrepareWebhooks(repo, HookEventDelete, &api.DeletePayload{
+ Ref: refName,
+ RefType: "tag",
+ PusherType: api.PusherTypeUser,
+ Repo: apiRepo,
+ Sender: apiPusher,
+ }); err != nil {
+ return fmt.Errorf("PrepareWebhooks.(delete tag): %v", err)
+ }
}
if isHookEventPush {