summaryrefslogtreecommitdiffstats
path: root/modules/repofiles
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repofiles')
-rw-r--r--modules/repofiles/action.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go
index 9467e4fb72..addbdb464c 100644
--- a/modules/repofiles/action.go
+++ b/modules/repofiles/action.go
@@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/webhook"
)
// CommitRepoActionOptions represent options of a new commit action.
@@ -112,7 +113,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
}
defer func() {
- go models.HookQueue.Add(repo.ID)
+ go webhook.HookQueue.Add(repo.ID)
}()
apiPusher := pusher.APIFormat()
@@ -134,7 +135,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
if err != nil {
log.Error("GetBranchCommitID[%s]: %v", opts.RefFullName, err)
}
- if err = models.PrepareWebhooks(repo, models.HookEventCreate, &api.CreatePayload{
+ if err = webhook.PrepareWebhooks(repo, models.HookEventCreate, &api.CreatePayload{
Ref: refName,
Sha: shaSum,
RefType: "branch",
@@ -148,7 +149,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
case models.ActionDeleteBranch: // Delete Branch
isHookEventPush = true
- if err = models.PrepareWebhooks(repo, models.HookEventDelete, &api.DeletePayload{
+ if err = webhook.PrepareWebhooks(repo, models.HookEventDelete, &api.DeletePayload{
Ref: refName,
RefType: "branch",
PusherType: api.PusherTypeUser,
@@ -169,7 +170,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
if err != nil {
log.Error("GetTagCommitID[%s]: %v", opts.RefFullName, err)
}
- if err = models.PrepareWebhooks(repo, models.HookEventCreate, &api.CreatePayload{
+ if err = webhook.PrepareWebhooks(repo, models.HookEventCreate, &api.CreatePayload{
Ref: refName,
Sha: shaSum,
RefType: "tag",
@@ -181,7 +182,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
case models.ActionDeleteTag: // Delete Tag
isHookEventPush = true
- if err = models.PrepareWebhooks(repo, models.HookEventDelete, &api.DeletePayload{
+ if err = webhook.PrepareWebhooks(repo, models.HookEventDelete, &api.DeletePayload{
Ref: refName,
RefType: "tag",
PusherType: api.PusherTypeUser,
@@ -197,7 +198,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
if err != nil {
return err
}
- if err = models.PrepareWebhooks(repo, models.HookEventPush, &api.PushPayload{
+ if err = webhook.PrepareWebhooks(repo, models.HookEventPush, &api.PushPayload{
Ref: opts.RefFullName,
Before: opts.OldCommitID,
After: opts.NewCommitID,