From ac83ab104c9d60faefdd61ff3828c4906111c6f4 Mon Sep 17 00:00:00 2001 From: Gosha Date: Fri, 5 Apr 2024 21:59:53 +0300 Subject: [PATCH] feat: bitbucket pullrequest:approved event support --- pkg/git_provider/bitbucket.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/git_provider/bitbucket.go b/pkg/git_provider/bitbucket.go index efbed56..9c509f3 100644 --- a/pkg/git_provider/bitbucket.go +++ b/pkg/git_provider/bitbucket.go @@ -102,7 +102,7 @@ func (b BitbucketClientImpl) SetWebhook(ctx *context.Context, repo *string) (*Ho Description: "Piper", Url: b.cfg.GitProviderConfig.WebhookURL, Active: true, - Events: []string{"repo:push", "pullrequest:created", "pullrequest:updated", "pullrequest:fulfilled"}, + Events: []string{"repo:push", "pullrequest:created", "pullrequest:updated", "pullrequest:fulfilled", "pullrequest:approved"}, } hook, exists := b.isRepoWebhookExists(*repo) @@ -189,7 +189,7 @@ func (b BitbucketClientImpl) HandlePayload(ctx *context.Context, request *http.R } } - case "pullrequest:created", "pullrequest:updated": + case "pullrequest:created", "pullrequest:updated", "pullrequest:approved": webhookPayload = &WebhookPayload{ Event: "pull_request", Repo: utils.SanitizeString(gjson.GetBytes(buf.Bytes(), "repository.name").Value().(string)),