summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-06-13 14:05:28 +0800
committerGitHub <noreply@github.com>2023-06-13 06:05:28 +0000
commit419804fd4d5cb655a51f245010b8eb1163b26bc2 (patch)
treed60bd3e695e11acf6b60e7a6be224989514426a1 /services
parent2126f712bfc0ea63705e54abbd14aec54299fa50 (diff)
downloadgitea-419804fd4d5cb655a51f245010b8eb1163b26bc2.tar.gz
gitea-419804fd4d5cb655a51f245010b8eb1163b26bc2.zip
Fix compatible for webhook ref type (#25195)
Fix #25185 Caused by #24634
Diffstat (limited to 'services')
-rw-r--r--services/actions/notifier.go4
-rw-r--r--services/webhook/notifier.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/services/actions/notifier.go b/services/actions/notifier.go
index 536b430b41..da870bb84c 100644
--- a/services/actions/notifier.go
+++ b/services/actions/notifier.go
@@ -384,7 +384,7 @@ func (n *actionsNotifier) NotifyCreateRef(ctx context.Context, pusher *user_mode
WithPayload(&api.CreatePayload{
Ref: refFullName.ShortName(),
Sha: refID,
- RefType: refFullName.RefGroup(),
+ RefType: refFullName.RefType(),
Repo: apiRepo,
Sender: apiPusher,
}).
@@ -401,7 +401,7 @@ func (n *actionsNotifier) NotifyDeleteRef(ctx context.Context, pusher *user_mode
WithRef(refFullName.ShortName()). // FIXME: should we use a full ref name
WithPayload(&api.DeletePayload{
Ref: refFullName.ShortName(),
- RefType: refFullName.RefGroup(),
+ RefType: refFullName.RefType(),
PusherType: api.PusherTypeUser,
Repo: apiRepo,
Sender: apiPusher,
diff --git a/services/webhook/notifier.go b/services/webhook/notifier.go
index e6d1875b29..bccd477852 100644
--- a/services/webhook/notifier.go
+++ b/services/webhook/notifier.go
@@ -755,7 +755,7 @@ func (m *webhookNotifier) NotifyCreateRef(ctx context.Context, pusher *user_mode
if err := PrepareWebhooks(ctx, EventSource{Repository: repo}, webhook_module.HookEventCreate, &api.CreatePayload{
Ref: refName, // FIXME: should it be a full ref name?
Sha: refID,
- RefType: refFullName.RefGroup(),
+ RefType: refFullName.RefType(),
Repo: apiRepo,
Sender: apiPusher,
}); err != nil {
@@ -791,12 +791,12 @@ func (m *webhookNotifier) NotifyDeleteRef(ctx context.Context, pusher *user_mode
if err := PrepareWebhooks(ctx, EventSource{Repository: repo}, webhook_module.HookEventDelete, &api.DeletePayload{
Ref: refName, // FIXME: should it be a full ref name?
- RefType: refFullName.RefGroup(),
+ RefType: refFullName.RefType(),
PusherType: api.PusherTypeUser,
Repo: apiRepo,
Sender: apiPusher,
}); err != nil {
- log.Error("PrepareWebhooks.(delete %s): %v", refFullName.RefGroup(), err)
+ log.Error("PrepareWebhooks.(delete %s): %v", refFullName.RefType(), err)
}
}