mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * load attributes when created release * update comparsion doc
This commit is contained in:
parent
188fe6c301
commit
24941a1046
33 changed files with 1010 additions and 118 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue