Skip to content

Commit

Permalink
fix: add tag event
Browse files Browse the repository at this point in the history
Signed-off-by: Gosha <[email protected]>
  • Loading branch information
gosharo committed Sep 5, 2023
1 parent 9aec7a4 commit 79b3bea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/git_provider/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ func (b BitbucketClientImpl) HandlePayload(ctx *context.Context, request *http.R
// https://support.atlassian.com/bitbucket-cloud/docs/event-payloads
switch request.Header.Get("X-Event-Key") {
case "repo:push":
switch gjson.GetBytes(buf.Bytes(), "push.changes.0.new.type").Value().(string) {
case "tag":
if gjson.GetBytes(buf.Bytes(), "push.changes.0.new.type").Value().(string) == "tag" {
webhookPayload = &WebhookPayload{
Event: "tag",
Repo: utils.SanitizeString(gjson.GetBytes(buf.Bytes(), "repository.name").Value().(string)),
Expand All @@ -178,7 +177,7 @@ func (b BitbucketClientImpl) HandlePayload(ctx *context.Context, request *http.R
User: gjson.GetBytes(buf.Bytes(), "actor.display_name").Value().(string),
HookID: hookID,
}
default:
} else {
webhookPayload = &WebhookPayload{
Event: "push",
Repo: utils.SanitizeString(gjson.GetBytes(buf.Bytes(), "repository.name").Value().(string)),
Expand Down

0 comments on commit 79b3bea

Please sign in to comment.