Skip to content

Commit a3a4721

Browse files
Merge pull request #63 from chhsia0/bitbucket-hook-skip-verify
Supporetd `skip_cert_verification` for bitbucket webhook registration.
2 parents 5208793 + 0a99bab commit a3a4721

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scm/driver/bitbucket/repo.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,18 @@ type hooks struct {
5151
type hook struct {
5252
Description string `json:"description"`
5353
URL string `json:"url"`
54-
SkipCertVerification bool `json:"skip_cert_verification"`
54+
SkipCertVerification bool `json:"skip_cert_verification,omitempty"`
5555
Active bool `json:"active"`
5656
Events []string `json:"events"`
5757
UUID string `json:"uuid"`
5858
}
5959

6060
type hookInput struct {
61-
Description string `json:"description"`
62-
URL string `json:"url"`
63-
Active bool `json:"active"`
64-
Events []string `json:"events"`
61+
Description string `json:"description"`
62+
URL string `json:"url"`
63+
SkipCertVerification bool `json:"skip_cert_verification,omitempty"`
64+
Active bool `json:"active"`
65+
Events []string `json:"events"`
6566
}
6667

6768
type repositoryService struct {
@@ -135,6 +136,7 @@ func (s *repositoryService) CreateHook(ctx context.Context, repo string, input *
135136
path := fmt.Sprintf("2.0/repositories/%s/hooks", repo)
136137
in := new(hookInput)
137138
in.URL = target.String()
139+
in.SkipCertVerification = input.SkipVerify
138140
in.Active = true
139141
in.Description = input.Name
140142
in.Events = append(

0 commit comments

Comments
 (0)