Skip to content

Commit a2a833c

Browse files
authored
[FIX] webhook creation payload ref
(cherry picked from commit 2c85a14)
1 parent 4a8eb1c commit a2a833c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

services/webhook/notifier.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,9 @@ func (m *webhookNotifier) PullRequestReviewRequest(ctx context.Context, doer *us
748748
func (m *webhookNotifier) CreateRef(ctx context.Context, pusher *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) {
749749
apiPusher := convert.ToUser(ctx, pusher, nil)
750750
apiRepo := convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm.AccessModeNone})
751-
refName := refFullName.ShortName()
752751

753752
if err := PrepareWebhooks(ctx, EventSource{Repository: repo}, webhook_module.HookEventCreate, &api.CreatePayload{
754-
Ref: refName, // FIXME: should it be a full ref name?
753+
Ref: refFullName.String(),
755754
Sha: refID,
756755
RefType: refFullName.RefType(),
757756
Repo: apiRepo,
@@ -785,10 +784,9 @@ func (m *webhookNotifier) PullRequestSynchronized(ctx context.Context, doer *use
785784
func (m *webhookNotifier) DeleteRef(ctx context.Context, pusher *user_model.User, repo *repo_model.Repository, refFullName git.RefName) {
786785
apiPusher := convert.ToUser(ctx, pusher, nil)
787786
apiRepo := convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm.AccessModeOwner})
788-
refName := refFullName.ShortName()
789787

790788
if err := PrepareWebhooks(ctx, EventSource{Repository: repo}, webhook_module.HookEventDelete, &api.DeletePayload{
791-
Ref: refName, // FIXME: should it be a full ref name?
789+
Ref: refFullName.String(),
792790
RefType: refFullName.RefType(),
793791
PusherType: api.PusherTypeUser,
794792
Repo: apiRepo,

0 commit comments

Comments
 (0)